问题
I'm trying to be able to get search results with special symbols like @. Every time I try to do this I don't get any hits and when I try without the special symbols everything works fine. Here is the request I'm making.
search?q=(or(prefix+field%3Demail+%27email@email%27)(term+field%3Demail+%27email@email%27))&q.parser=structured&return=user
回答1:
The symbols are being removed during text processing as described in Text Processing
According to the word break rules, strings separated by whitespace such as spaces and tabs are treated as separate tokens. In many cases, punctuation is dropped and treated as whitespace. For example, strings are split at hyphens (-) and the at symbol (@).
You may be able to solve this with a different Text Analysis scheme
回答2:
You can set the field as literal as literal fields are not tokenized.
回答3:
Fix it by replacing @ to a different character.
来源:https://stackoverflow.com/questions/34298419/how-to-search-special-symbols-aws-search