# Search fields without Stopwords

**URL:** <https://discuss.elastic.co/t/search-fields-without-stopwords/117977>\
**Category:** Elasticsearch\
**Created:** [February 1, 2018, 9:11am UTC](https://discuss.elastic.co/t/search-fields-without-stopwords/117977 "2018-02-01T09:11:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoelS1](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@JoelS1](https://discuss.elastic.co/u/JoelS1)\
**Post date:** [February 1, 2018, 9:11am UTC](https://discuss.elastic.co/t/search-fields-without-stopwords/117977/1 "2018-02-01T09:11:14Z")

</div>

Hello together,

I have a question about searching fields.

My Question is how can I use an analyzer in a match\_all query? The only thing I saw was when people used a analyzer on a specfic text like 'Text: **"How are you"'**.

Well I wan't to filter out some common words out of a field which is called "Inhalt" I think using stopwords is the right solution but Iam not sure how to use them related to a match\_all query.

**My goal is** to get a list of often used words (keywords) without common words like (the, about, able .. and so on)

Current Search Query:  
//GET \_search  
{  
"query": {  
"match\_all": {}  
},  
"aggs": {  
"nachrichten": {  
"terms": {  
"field": "inhalt",  
"size": "1000"  
}  
}  
},  
"size": 0  
}

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [February 1, 2018, 10:54am UTC](https://discuss.elastic.co/t/search-fields-without-stopwords/117977/2 "2018-02-01T10:54:01Z")

</div>

> [@JoelS1](#):
>
> how can I use an analyzer in a match\_all query?

A `match_all` query does exactly that - it matches _all_ docs. I expect you are more interested in the [match query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html).

The choice of analyzer is tied to the mapping definition for the field. The `match` query will automatically tokenize your search terms using the analyzer that is associated for your choice of field being queried.

---

<div class="post-metadata">

**Author:** ![JoelS1](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@JoelS1](https://discuss.elastic.co/u/JoelS1)\
**Post date:** [February 1, 2018, 12:58pm UTC](https://discuss.elastic.co/t/search-fields-without-stopwords/117977/3 "2018-02-01T12:58:17Z")

</div>

Thanks for the answer.

So basically I just need to map a field with an analyzer which is using the _english_ stopwords list for example?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [February 1, 2018, 1:15pm UTC](https://discuss.elastic.co/t/search-fields-without-stopwords/117977/4 "2018-02-01T13:15:24Z")

</div>

> [@JoelS1](#):
>
> So basically I just need to map a field with an analyzer which is using the english stopwords list for example?

Yep - if required you can configure your own analyzer with a custom set of stopwords.

---

<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:** [March 1, 2018, 1:15pm UTC](https://discuss.elastic.co/t/search-fields-without-stopwords/117977/5 "2018-03-01T13:15:46Z")

</div>

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