在Elasticsearch中,我想使用自定义分析器为某些字段建立索引。因此,我将分析仪添加到其他配置中:
{
"analysis":{
"analyzer": {
"my_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"polish_stem",
"asciifolding",
"pl_stop"
]
}
}
}
,然后我添加了新的映射(例如,覆盖类型映射):
"title": {
"type": "text",
"boost": 9500,
"store": true,
"term_vector": "with_positions_offsets",
"analyzer": "my_analyzer"},
然后,我删除索引并重新启动Liferay。 Portal使用我的custo映射和分析器正确创建了一个新索引。然后我重新索引了我的文档。当我在Elasticsearch中搜索某物时,它显示了预期的结果,我发现它可以根据需要分析我的字段。但是,当我通过Liferay门户进行搜索时,看不到任何变化,我的领域也没有得到分析。我做错了什么?我有新索引,数据来自该索引,那么为什么Liferay不使用它?
PS:我试图将嵌套字段添加到主字段并为它们设置不同的映射,但是Liferay不想使用嵌套字段ex搜索。 “ title.analyzed_field”。 谢谢您的任何建议!