【发布时间】:2018-04-11 08:03:39
【问题描述】:
在 Elasticsearch 中,我有一个名为“地址”的字段,在该字段中数据被索引为
"322 Wall Tax Road"
在每个单词之间添加了多个空格。因此,在搜索“322 Wall Tax Road”时不会返回数据。
有没有办法在不重新索引的情况下忽略额外的空格。 谢谢。
这是我当前的映射
"mappings": {
"esiid": {
"properties": {
"address": {
"type": "string",
"index": "not_analyzed"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
}
}
}
【问题讨论】:
-
你考虑过正则表达式吗?将字符串拆分为单词,并在每个单词之间使用正则表达式来处理多个空格:elastic.co/guide/en/elasticsearch/reference/current/…
标签: php elasticsearch elasticsearch-plugin elasticsearch-5