摘要: elasticsearch中存在關聯的類的相同字段(類型、名稱都相同)要用同樣的方式解析(index=FieldIndex.no/ analyzed / not_analy...
elasticsearch中存在關聯的類的相同字段(類型、名稱都相同)要用同樣的方式解析(index=FieldIndex.no/ analyzed / not_analyzed),否則會沖突;
注解作用說明:
@Field(type = FieldType.Long, index = FieldIndex.not_analyzed, store = true)
type:es按照什么數據類型解析這個Field;
index:
FieldIndex.not_analyzed:不會分詞,只能根據原詞索引Field;
FieldIndex.analyzed:根據分詞器分詞,可以根據原詞和分詞后的詞條索引Field;
FieldIndex.no:該字段不會被索引,查不到;
store:es是否會存儲這個Field的內容;