2017-09-04 48 views
1

我正試圖使用​​以下過濾器查詢包含電子郵件地址的彈性搜索中的列。Elastic Search中的查詢電子郵件列

{ 
"query": { 
"bool": { 
    "must": [ 

    { 
     "term": { 
     "from":"[email protected]" 

     } 
    } 
    ] 
} 
}, 
    "from": 0, 
    "size": 10, 
    "sort": [], 
    "aggs": {} 
} 

如果我嘗試andrei它工作正常。另外如果我嘗試hotmail.com123。但是,如果我嘗試搜索[email protected],則不會返回任何內容。任何線索爲什麼?

+0

這個答案應該有所幫助:https://stackoverflow.com/questions/35124725/emails - 不是幸福,搜索的正常功能於elasticsearch/35124883#35124883 – Val

回答

0

我們發現這個答案,似乎工作,考慮到我們的代碼替換@爲空字符串

{ 
"query": { 

     { 
    "match" : { 
     "from" : { 
      "query" : "andrei hotmail.com123", 
      "operator" : "and" 
     } 
    } 
     } 
]}} 
} 
相關問題