# Stop words not working when setting analyzer in settings

**URL:** <https://discuss.elastic.co/t/stop-words-not-working-when-setting-analyzer-in-settings/9829>\
**Category:** Elasticsearch\
**Created:** [November 26, 2012, 8:26pm UTC](https://discuss.elastic.co/t/stop-words-not-working-when-setting-analyzer-in-settings/9829 "2012-11-26T20:26:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![racedo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/racedo/32/2499_2.png) [@racedo](https://discuss.elastic.co/u/racedo)\
**Post date:** [November 26, 2012, 8:26pm UTC](https://discuss.elastic.co/t/stop-words-not-working-when-setting-analyzer-in-settings/9829/1 "2012-11-26T20:26:07Z")

</div>

I'm trying to change the haystack default settings to something very simple:

```
   'settings': {
            "analyzer": "spanish"
    }

```

It looks right after rebuilding the index:

$ curl -XGET '[http://localhost:9200/haystack/\_settings?pretty=true](http://localhost:9200/haystack/_settings?pretty=true)'  
{  
"haystack" : {  
"settings" : {  
"index.analyzer" : "spanish",  
"index.number\_of\_shards" : "5",  
"index.number\_of\_replicas" : "1",  
"index.version.created" : "191199"  
}  
}

But when testing it with some stop words it won't work as expected (it  
should filter out "esto" and "que"):

$ curl -XGET  
'localhost:9200/haystack/\_analyze?text=esto+is+a+test+que&pretty=true'  
{  
"tokens" : [ {  
"token" : "esto",  
"start\_offset" : 0,  
"end\_offset" : 4,  
"type" : "",  
"position" : 1  
}, {  
"token" : "test",  
"start\_offset" : 10,  
"end\_offset" : 14,  
"type" : "",  
"position" : 4  
}, {  
"token" : "que",  
"start\_offset" : 15,  
"end\_offset" : 18,  
"type" : "",  
"position" : 5  
} ]

And only when I specify the analyzer in the query it works:

$ curl -XGET  
'localhost:9200/haystack/\_analyze?text=esto+is+a+test+que&analyzer=spanish&pretty=true'  
{  
"tokens" : [ {  
"token" : "is",  
"start\_offset" : 5,  
"end\_offset" : 7,  
"type" : "",  
"position" : 2  
}, {  
"token" : "test",  
"start\_offset" : 10,  
"end\_offset" : 14,  
"type" : "",  
"position" : 4  
} ]

Any idea of what am I doing wrong?

Thanks.

--

---

<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, 3:02am UTC](https://discuss.elastic.co/t/stop-words-not-working-when-setting-analyzer-in-settings/9829/2 "2017-07-06T03:02:55Z")

</div>


