How Elasticsearch can search for characters like @

I am having trouble writing an Elasticsearch request.
My request is below

{
"query": {
    "query_string": {
        "default_field": "content",
        "query": "@lin1"
    }
},
"from": 0,
"size": 1000,
"sort": [
    {
        "time": "desc"
    }
]
}

And I use query_string
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
But the character @cannot match.
This will produce the following result: lin1orใ€Œlin1ใ€

enter image description here

So how do I write a query Elasticsearchto match @lin1?

+4
source share
1 answer

. , , "@" . "@" . , "@" , query_string :

"query_string": {
    "default_field": "content",
    "query": "@lin1",
    "analyzer": "whitespace"
}
+1

All Articles