2
我的目标是能够搜索词与周围括号,例如:ElasticSearch映射Charfilter
(安迪)
从什么,如果我做一个映射Charfilter我可以告诉,改变括号强调这将完成我所追求的。
"index" : {
"analysis" : {
"char_filter" : {
"my_mapping" : {
"type" : "mapping",
"mappings" : ["(=> _", ") => _"]
}
},
"analyzer" : {
"custom_with_char_filter" : {
"tokenizer" : "standard",
"char_filter" : ["my_mapping"]
},
}
}
}
}';
当运行上述我得到以下错误:
{ “错误”:“ElasticSearchParseException [无法解析源创建索引];嵌套:JsonParseException [意外字符( '}'(代码125)):在[Source:[B @ 70de7f1b; line:15,column:14]];期待有效的名称字符(用于未加引号的名称)或双引号(用于引用)来开始字段名称\ n; ,“状态”:400}
谢谢imotov。删除额外的逗号确实解决了错误问题。但是现在我收到错误消息:“{”error“:”IndexAlreadyExistsException [[xenforo113] Already exists]“,”status“:400}”。在阅读更多关于我想要做的事情时,我无法将此映射添加到现有索引。我想我需要删除索引,创建一个新的分析器并重新编制索引。 –
是的,您需要删除索引并重新编制索引。 – imotov