2
私は、別のネストされたフィールドを含むネストされたフィールドを持つElasticsearchドキュメントのインデックスを作成しています(フィールドの2ステップツリー)。内部のネストされたフィールドのデータに基づいてドキュメントを照合します。これは機能しません。ネストされたフィルタを使用したElasticSearchクエリは機能しません
NestedFilterBuilderは、これは私がインデックスが構築されているクエリ
orFilter.add(termFilter("event_attribute_value","president"));
NestedFilterBuilder nestedFilterBuilder = new NestedFilterBuilder("eventnested.attributes", orFilter);
finalFilter.add(nestedFilterBuilder);
マッピングが
"eventnested":{
"type" : "nested", "store" : "yes", "index" : "analyzed", "omit_norms" : "true",
"include_in_parent":true,
"properties":{
"event_type":{"type" : "string", "store" : "yes", "index" : "analyzed","omit_norms" : "true"},
"attributes":{
"type" : "nested", "store" : "yes", "index" : "analyzed", "omit_norms" : "true",
"include_in_parent":true,
"properties":{
"event_attribute_name":{"type" : "string", "store" : "yes", "index" : "analyzed","omit_norms" : "true"},
"event_attribute_value":{"type" : "string", "store" : "yes", "index" : "analyzed","omit_norms" : "true"}
}
},
"event_attribute_instance":{"type" : "integer", "store" : "yes", "precision_step" : "0"}
}
}
で生成するのに使用していたJavaで
"nested" : {
"filter" : {
"or" : {
"filters" : [ {
"term" : {
"event_attribute_value" : "Obama"
}
}, {
"term" : {
"event_attribute_value" : "President"
}
} ]
}
},
"path" : "eventnested.attributes"
}
... 1以下のようになります。
私が間違って使っていることはありますか?
ありがとうございました。私は、フィールドnot_analyzedをqueryfilterbuilderの使用と共に作成しました。 – Manoj