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

**URL:** <https://discuss.elastic.co/t/es-search-query-results-returns-nothing-with-a-search-criteria-value-as-an/97934>\
**Category:** Elasticsearch\
**Created:** [August 22, 2017, 3:09pm UTC](https://discuss.elastic.co/t/es-search-query-results-returns-nothing-with-a-search-criteria-value-as-an/97934 "2017-08-22T15:09:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drkkumar](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@drkkumar](https://discuss.elastic.co/u/drkkumar)\
**Post date:** [August 22, 2017, 3:09pm UTC](https://discuss.elastic.co/t/es-search-query-results-returns-nothing-with-a-search-criteria-value-as-an/97934/1 "2017-08-22T15:09:36Z")

</div>

Hi,  
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  
}  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 25, 2017, 8:21am UTC](https://discuss.elastic.co/t/es-search-query-results-returns-nothing-with-a-search-criteria-value-as-an/97934/2 "2017-08-25T08:21:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![drkkumar](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@drkkumar](https://discuss.elastic.co/u/drkkumar)\
**Post date:** [August 30, 2017, 3:03pm UTC](https://discuss.elastic.co/t/es-search-query-results-returns-nothing-with-a-search-criteria-value-as-an/97934/3 "2017-08-30T15:03:29Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 31, 2017, 6:42am UTC](https://discuss.elastic.co/t/es-search-query-results-returns-nothing-with-a-search-criteria-value-as-an/97934/4 "2017-08-31T06:42:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 28, 2017, 6:42am UTC](https://discuss.elastic.co/t/es-search-query-results-returns-nothing-with-a-search-criteria-value-as-an/97934/5 "2017-09-28T06:42:58Z")

</div>

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