0
我運行下面的查詢elasticseach特殊字符轉義
GET myindex/my_type/_search
{
"query": {
"query_string": {
"default_field": "campaign_new",
"query": "(firtPart - Second Third)"
}
}
}
和我得到
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
但我對這項運動的值,如果我做了MATCH_ALL搜索,但它不被取通過這個查詢。我懷疑這可能是由於逃逸問題。但是當我嘗試firtPart \- Second\ Third
時,它在Sense中顯示錯誤。
但這也給了我一樣的。你可以請用連字符更新答案兩次逃脫? – 2015-03-19 08:41:19
我已經用hypen更新了答案逃脫了兩次。 – 2015-03-19 09:12:54
但這也沒有給我任何結果。但術語查詢確實如此。我需要使用查詢字符串,因爲我需要使用'AND'和'OR'來比較多個值,比如「campaign_new:new_value AND network_new:new_value」。有沒有其他的方式來做到這一點? – 2015-03-19 09:17:24