ES Search query results returns nothing with a search criteria value as 'AN'

I tried to retrieve data which has 'AN' value. The query returns an empty results even though the document is available in ES. If I give any other value other than 'AN' then the query returns results as expected.

Is this anything related to 'AN'? Am I missing anything?.

Query used:
"from": 0,
"size": 100,
"query": {
"bool": {
"must": [
"match": {
"receiver": {
"query": "AN",
"type": "boolean"

ES has the below document
_index: messages
_type: ABCType
_id: 4571b1a9-d0eb-4e98-bc3f-562d2ee8e206
_version: 1
_score: 1
_source: {
sender_name: Unknown
receiver: AN

wild guess (please provide more information like a the mapping of that field plus a sample document, plus the Elasticsearch version, plus the JVM version): Is this field using an analyzer that makes use of stopwords? Have you tried with an analyzer that is not using stopwords?

1 Like

Thanks for your inputs. We are using the 2.4 version

We did the below modification and ES return results for the search criteria 'AN' .
index :
analysis :
analyzer :
default :
type : standard
stopwords : [you]

We are thinking of modify the stopwords settings as "none". Does it affect ES performance?

It does affect the needed storage space, as you have to store extra information in the inverted index about terms that occur in many documents. If it affects performance is incredible hard to tell without knowing the data.

By default Elasticsearch stores stopwords with the standard analyzer to prevent such issues as above.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.