1
嘗試添加術語方面時,我遇到了術語將標記化爲單獨單詞的問題。例如,如果屬性(字段)Kind
具有值medium kind of shirt
和large kind of shirt
,則該術語變成:-,large
,kind
,of
,shirt
。爲字段的所有子字段設置「索引」屬性
爲了解決這個問題,建議我將映射更改爲包含每個屬性字段的"index": "not_analyzed"
。問題是,映射是動態生成的,比如 - :
"attributes": {
"properties": {
"kind": {
"type": "string"
},
"color": {
"type": "string"
},
"size": {
"type": "string"
}
}
}
簡單的設置裏面"attributes"
的"not_analyzed"
位不會做。有沒有辦法爲attributes
字段中的每個子字段設置索引屬性?
如果它是動態生成的,那麼你應該能夠爲它定義一個動態模板,你可以在其中指定'index'屬性。有關動態映射的詳細信息,請參閱:http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html –