1
我的類型是用戶:電子郵件和用戶名。彈性搜索標記我的查詢字符串,一個電子郵件地址。如何阻止它?
電子郵件字段設置爲string類型,使用自定義分析「exact_lower」:
index.analysis.analyzer.exact_lower:
type: custom
tokenizer: keyword
filter : lowercase
問題是,當我搜索猶如「@」是它返回匹配的完整的電子郵件地址空間。我認爲由於它標記搜索。
查詢我送的:
{
"query" : {
"query_string" : {
"query" : "[email protected]"
}
}
}
它返回任何符合 '管理' 或 'example.com'。例如。 [email protected],[email protected]和[email protected]。我想它只返回[email protected] ...
我想我需要告訴搜索不要標記query_string
,但一直沒能弄清楚如何做到這一點。
任何幫助非常感謝!謝謝, Seth
謝謝安德烈 – sethmuss