小编Rud*_*dra的帖子

在elasticsearch中搜索特殊字符

我无法在字符结尾/以特殊字符开头的Elasticsearch中进行搜索.比如"123456!"

{
 "query": {
    "query_string": {
        "default_field": "password",
        "query": "123456!"
    }
 }
}
Run Code Online (Sandbox Code Playgroud)

我的映射是

{
  "mappings": {
    "passwords": { 
      "properties": {
        "date":    { "type": "date"}, 
        "password":    { "type": "string","index": "not_analyzed"}, 

      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

它给了我错误,我可以在我的搜索查询(或映射)中做什么,以便特殊字符将被视为搜索字符串的一部分?

elasticsearch

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

elasticsearch ×1