# Remove all stopwords

**URL:** <https://discuss.elastic.co/t/remove-all-stopwords/13934>\
**Category:** Elasticsearch\
**Created:** [October 13, 2013, 6:52pm UTC](https://discuss.elastic.co/t/remove-all-stopwords/13934 "2013-10-13T18:52:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Squires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_squires/32/2046_2.png) [@David\_Squires](https://discuss.elastic.co/u/David_Squires)\
**Post date:** [October 13, 2013, 6:52pm UTC](https://discuss.elastic.co/t/remove-all-stopwords/13934/1 "2013-10-13T18:52:50Z")

</div>

Hello,

We're using the standard analyzer and it's not working out so well for our  
purpose. We want to remove all of the stopwords, for our search  
'the','and,'this' are actually important terms.

Is there anyway to do this using a filter? I've tried to re-index using  
this:

curl -XPUT "localhost:9200/files/\_settings" -d ' {  
"index": {  
"analysis" : {  
"analyzer" : {  
"standard" : {  
"stopwords" : []  
}  
}  
}  
}  
}'

This returned  
{"ok":true}

But doesn't seem to be have any effect on our queries using:

{  
query : {  
field : {  
name : the dog  
}  
}  
}

Any suggestions would be great!

Thank you

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 13, 2013, 9:31pm UTC](https://discuss.elastic.co/t/remove-all-stopwords/13934/2 "2013-10-13T21:31:48Z")

</div>

Use another analyzer instead standard one.  
See [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html)

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 13 oct. 2013 à 20:52, David Squires [dave@bluetopmedia.com](mailto:dave@bluetopmedia.com) a écrit :

Hello,

We're using the standard analyzer and it's not working out so well for our purpose. We want to remove all of the stopwords, for our search 'the','and,'this' are actually important terms.

Is there anyway to do this using a filter? I've tried to re-index using this:

curl -XPUT "localhost:9200/files/\_settings" -d ' {  
"index": {  
"analysis" : {  
"analyzer" : {  
"standard" : {  
"stopwords" : []  
}  
}  
}  
}  
}'

This returned  
{"ok":true}

But doesn't seem to be have any effect on our queries using:

{  
query : {  
field : {  
name : the dog  
}  
}  
}

Any suggestions would be great!

## Thank you

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![David\_Squires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_squires/32/2046_2.png) [@David\_Squires](https://discuss.elastic.co/u/David_Squires)\
**Post date:** [October 13, 2013, 10:19pm UTC](https://discuss.elastic.co/t/remove-all-stopwords/13934/3 "2013-10-13T22:19:26Z")

</div>

Hi David,

Thank you for the reply. So, I've attempted at creating a custom analyzer,  
but no luck. Here's what i've set:

curl -XPUT "localhost:9200/files/\_settings" -d ' {  
"index": {  
"analysis" : {  
"analyzer" : {  
"noStopAnalyzer" : {  
"type" : "custom",  
"tokenizer" : "noStopTokenizer",  
"filter" : [noStops]  
}  
},  
"tokenizer" : {  
"noStopTokenizer" : {  
"type" : "standard"  
}  
},  
"filter" : {  
"noStops" : {  
"type" : "stop",  
"stopwords" :   
}  
}  
}  
}  
}'

I get an error:

Unrecognized token 'noStops': was expecting \n

Any ideas?

Thanks!

On Sunday, October 13, 2013 5:31:48 PM UTC-4, David Pilato wrote:

> Use another analyzer instead standard one.  
> See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html)
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 13 oct. 2013 à 20:52, David Squires \<[da...@bluetopmedia.com](mailto:da...@bluetopmedia.com)\<javascript:\>\>  
> a écrit :
> 
> Hello,
> 
> We're using the standard analyzer and it's not working out so well for our  
> purpose. We want to remove all of the stopwords, for our search  
> 'the','and,'this' are actually important terms.
> 
> Is there anyway to do this using a filter? I've tried to re-index using  
> this:
> 
> curl -XPUT "localhost:9200/files/\_settings" -d ' {  
> "index": {  
> "analysis" : {  
> "analyzer" : {  
> "standard" : {  
> "stopwords" :   
> }  
> }  
> }  
> }  
> }'
> 
> This returned  
> {"ok":true}
> 
> But doesn't seem to be have any effect on our queries using:
> 
> {  
> query : {  
> field : {  
> name : the dog  
> }  
> }  
> }
> 
> Any suggestions would be great!
> 
> Thank you
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![David\_Squires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_squires/32/2046_2.png) [@David\_Squires](https://discuss.elastic.co/u/David_Squires)\
**Post date:** [October 13, 2013, 10:21pm UTC](https://discuss.elastic.co/t/remove-all-stopwords/13934/4 "2013-10-13T22:21:39Z")

</div>

Ah, It looks like it just had to be in quotes.

I've tried with that and it parses, but then I get the error:

ElasticSearchIllegalArgumentException[Can't update non dynamic settings[

On Sunday, October 13, 2013 6:19:26 PM UTC-4, David Squires wrote:

> Hi David,
> 
> Thank you for the reply. So, I've attempted at creating a custom  
> analyzer, but no luck. Here's what i've set:
> 
> curl -XPUT "localhost:9200/files/\_settings" -d ' {  
> "index": {  
> "analysis" : {  
> "analyzer" : {  
> "noStopAnalyzer" : {  
> "type" : "custom",  
> "tokenizer" : "noStopTokenizer",  
> "filter" : [noStops]  
> }  
> },  
> "tokenizer" : {  
> "noStopTokenizer" : {  
> "type" : "standard"  
> }  
> },  
> "filter" : {  
> "noStops" : {  
> "type" : "stop",  
> "stopwords" :   
> }  
> }  
> }  
> }  
> }'
> 
> I get an error:
> 
> Unrecognized token 'noStops': was expecting \n
> 
> Any ideas?
> 
> Thanks!
> 
> On Sunday, October 13, 2013 5:31:48 PM UTC-4, David Pilato wrote:
> 
> > Use another analyzer instead standard one.  
> > See  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html)
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 13 oct. 2013 à 20:52, David Squires [da...@bluetopmedia.com](mailto:da...@bluetopmedia.com) a écrit :
> > 
> > Hello,
> > 
> > We're using the standard analyzer and it's not working out so well for  
> > our purpose. We want to remove all of the stopwords, for our search  
> > 'the','and,'this' are actually important terms.
> > 
> > Is there anyway to do this using a filter? I've tried to re-index using  
> > this:
> > 
> > curl -XPUT "localhost:9200/files/\_settings" -d ' {  
> > "index": {  
> > "analysis" : {  
> > "analyzer" : {  
> > "standard" : {  
> > "stopwords" :   
> > }  
> > }  
> > }  
> > }  
> > }'
> > 
> > This returned  
> > {"ok":true}
> > 
> > But doesn't seem to be have any effect on our queries using:
> > 
> > {  
> > query : {  
> > field : {  
> > name : the dog  
> > }  
> > }  
> > }
> > 
> > Any suggestions would be great!
> > 
> > Thank you
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![David\_Squires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_squires/32/2046_2.png) [@David\_Squires](https://discuss.elastic.co/u/David_Squires)\
**Post date:** [October 13, 2013, 10:32pm UTC](https://discuss.elastic.co/t/remove-all-stopwords/13934/5 "2013-10-13T22:32:27Z")

</div>

Ok, so I found that I have to do this first:

curl -XPOST "localhost:9200/files/\_close"

then I ran it and then re-opened it using:

curl -XPOST "localhost:9200/files/\_open"

Is there anything else I would need to do? Do I just set {"filter" :  
"noStops"} in my query?

Doesn't seem to be making a difference.

On Sunday, October 13, 2013 6:21:39 PM UTC-4, David Squires wrote:

> Ah, It looks like it just had to be in quotes.
> 
> I've tried with that and it parses, but then I get the error:
> 
> ElasticSearchIllegalArgumentException[Can't update non dynamic settings[
> 
> On Sunday, October 13, 2013 6:19:26 PM UTC-4, David Squires wrote:
> 
> > Hi David,
> > 
> > Thank you for the reply. So, I've attempted at creating a custom  
> > analyzer, but no luck. Here's what i've set:
> > 
> > curl -XPUT "localhost:9200/files/\_settings" -d ' {  
> > "index": {  
> > "analysis" : {  
> > "analyzer" : {  
> > "noStopAnalyzer" : {  
> > "type" : "custom",  
> > "tokenizer" : "noStopTokenizer",  
> > "filter" : [noStops]  
> > }  
> > },  
> > "tokenizer" : {  
> > "noStopTokenizer" : {  
> > "type" : "standard"  
> > }  
> > },  
> > "filter" : {  
> > "noStops" : {  
> > "type" : "stop",  
> > "stopwords" :   
> > }  
> > }  
> > }  
> > }  
> > }'
> > 
> > I get an error:
> > 
> > Unrecognized token 'noStops': was expecting \n
> > 
> > Any ideas?
> > 
> > Thanks!
> > 
> > On Sunday, October 13, 2013 5:31:48 PM UTC-4, David Pilato wrote:
> > 
> > > Use another analyzer instead standard one.  
> > > See  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html)
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 13 oct. 2013 à 20:52, David Squires [da...@bluetopmedia.com](mailto:da...@bluetopmedia.com) a  
> > > écrit :
> > > 
> > > Hello,
> > > 
> > > We're using the standard analyzer and it's not working out so well for  
> > > our purpose. We want to remove all of the stopwords, for our search  
> > > 'the','and,'this' are actually important terms.
> > > 
> > > Is there anyway to do this using a filter? I've tried to re-index using  
> > > this:
> > > 
> > > curl -XPUT "localhost:9200/files/\_settings" -d ' {  
> > > "index": {  
> > > "analysis" : {  
> > > "analyzer" : {  
> > > "standard" : {  
> > > "stopwords" :   
> > > }  
> > > }  
> > > }  
> > > }  
> > > }'
> > > 
> > > This returned  
> > > {"ok":true}
> > > 
> > > But doesn't seem to be have any effect on our queries using:
> > > 
> > > {  
> > > query : {  
> > > field : {  
> > > name : the dog  
> > > }  
> > > }  
> > > }
> > > 
> > > Any suggestions would be great!
> > > 
> > > Thank you
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 14, 2013, 4:58am UTC](https://discuss.elastic.co/t/remove-all-stopwords/13934/6 "2013-10-14T04:58:02Z")

</div>

Don't add the stopword filter and you're done.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 14 oct. 2013 à 00:32, David Squires [dave@bluetopmedia.com](mailto:dave@bluetopmedia.com) a écrit :

> Ok, so I found that I have to do this first:
> 
> curl -XPOST "localhost:9200/files/\_close"
> 
> then I ran it and then re-opened it using:
> 
> curl -XPOST "localhost:9200/files/\_open"
> 
> Is there anything else I would need to do? Do I just set {"filter" : "noStops"} in my query?
> 
> Doesn't seem to be making a difference.
> 
> On Sunday, October 13, 2013 6:21:39 PM UTC-4, David Squires wrote:
> 
> > Ah, It looks like it just had to be in quotes.
> > 
> > I've tried with that and it parses, but then I get the error:
> > 
> > ElasticSearchIllegalArgumentException[Can't update non dynamic settings[
> > 
> > On Sunday, October 13, 2013 6:19:26 PM UTC-4, David Squires wrote:
> > 
> > > Hi David,
> > > 
> > > Thank you for the reply. So, I've attempted at creating a custom analyzer, but no luck. Here's what i've set:
> > > 
> > > curl -XPUT "localhost:9200/files/\_settings" -d ' {  
> > > "index": {  
> > > "analysis" : {  
> > > "analyzer" : {  
> > > "noStopAnalyzer" : {  
> > > "type" : "custom",  
> > > "tokenizer" : "noStopTokenizer",  
> > > "filter" : [noStops]  
> > > }  
> > > },  
> > > "tokenizer" : {  
> > > "noStopTokenizer" : {  
> > > "type" : "standard"  
> > > }  
> > > },  
> > > "filter" : {  
> > > "noStops" : {  
> > > "type" : "stop",  
> > > "stopwords" :   
> > > }  
> > > }  
> > > }  
> > > }  
> > > }'
> > > 
> > > I get an error:
> > > 
> > > Unrecognized token 'noStops': was expecting \n
> > > 
> > > Any ideas?
> > > 
> > > Thanks!
> > > 
> > > On Sunday, October 13, 2013 5:31:48 PM UTC-4, David Pilato wrote:
> > > 
> > > > Use another analyzer instead standard one.  
> > > > See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html)
> > > > 
> > > > --  
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 13 oct. 2013 à 20:52, David Squires [da...@bluetopmedia.com](mailto:da...@bluetopmedia.com) a écrit :
> > > > 
> > > > Hello,
> > > > 
> > > > We're using the standard analyzer and it's not working out so well for our purpose. We want to remove all of the stopwords, for our search 'the','and,'this' are actually important terms.
> > > > 
> > > > Is there anyway to do this using a filter? I've tried to re-index using this:
> > > > 
> > > > curl -XPUT "localhost:9200/files/\_settings" -d ' {  
> > > > "index": {  
> > > > "analysis" : {  
> > > > "analyzer" : {  
> > > > "standard" : {  
> > > > "stopwords" :   
> > > > }  
> > > > }  
> > > > }  
> > > > }  
> > > > }'
> > > > 
> > > > This returned  
> > > > {"ok":true}
> > > > 
> > > > But doesn't seem to be have any effect on our queries using:
> > > > 
> > > > {  
> > > > query : {  
> > > > field : {  
> > > > name : the dog  
> > > > }  
> > > > }  
> > > > }
> > > > 
> > > > Any suggestions would be great!
> > > > 
> > > > ## Thank you
> > > > 
> > > > You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:12am UTC](https://discuss.elastic.co/t/remove-all-stopwords/13934/7 "2017-07-06T02:12:42Z")

</div>


