Ich hatte das gleiche Problem. Bitte machen Sie Folgendes, damit es funktioniert.
sicher, dass Sie löschte die Indizes:
DELETE Anfrage per Postbote zum Beispiel: http://127.0.0.1:9200/ {your_name}
Dann in Knoten JS Erstellen Sie eine Zuordnung wie folgt aus:
var schema = new Schema({
product_name: String,
description: {
type: String,
es_type: 'multi_field',
es_fields: {
multi_field: { type: 'string', index: 'analyzed' },
untouched: { type: 'string', index: 'not_analyzed' }
}
}
});
Schließlich können Sie Frage wie folgt:
{
"query" : {
"constant_score" : {
"filter" : {
"term" : {
"description.multi_field" : "nog een testje"
}
}
}
}}// to use other field, change the . after description
{
"query" : {
"constant_score" : {
"filter" : {
"term" : {
"description.untouched" : "nog een testje"
}
}
}
}
}