# Stop words not indexed (custom edgeNGram analyzer with not STOP filter)

**URL:** <https://discuss.elastic.co/t/stop-words-not-indexed-custom-edgengram-analyzer-with-not-stop-filter/7587>\
**Category:** Elasticsearch\
**Created:** [May 7, 2012, 8:04pm UTC](https://discuss.elastic.co/t/stop-words-not-indexed-custom-edgengram-analyzer-with-not-stop-filter/7587 "2012-05-07T20:04:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_Boutros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robin_boutros/32/1727_2.png) [@Robin\_Boutros](https://discuss.elastic.co/u/Robin_Boutros)\
**Post date:** [May 7, 2012, 8:04pm UTC](https://discuss.elastic.co/t/stop-words-not-indexed-custom-edgengram-analyzer-with-not-stop-filter/7587/1 "2012-05-07T20:04:14Z")

</div>

Hey,

That's how I define my mapping with Tire:

settings :analysis =\> {  
:filter =\> {  
:title\_ngram =\> {  
type: "edgeNGram",  
side: "front",  
max\_gram: 15,  
min\_gram: 1  
}  
},  
tokenizer: {  
title\_tokenizer: {  
pattern: "[^\p{L}\d]+",  
type: "pattern"  
}  
},  
:analyzer =\> {  
_:ngram\_analyzer_ =\> {  
tokenizer: "title\_tokenizer",  
_filter: ["lowercase", "title\_ngram"],_  
type: "custom"  
}  
}  
} do  
mapping do  
indexes :id, type: 'integer'  
indexes :title, type: 'string', analyzer: 'snowball'  
indexes :description, type: 'string', analyzer: 'snowball'  
indexes :small\_photo, index: :not\_analyzed  
_indexes :ngram\_title, :type =\> 'string', :index\_analyzer =\>  
"ngram\_analyzer", search\_analyzer: "standard"_  
end  
end

I have 2 documents: "The Tree" and "Isnogood".

When I search for "th", "The Tree" is found. With "The", it's not.  
When I search for "i", "Isnogood" is found. With "is", it's not.

Why arent stop words indexed? There is no "stop" filter for the  
ngram\_analyzer...

Thanks!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 9, 2012, 9:19am UTC](https://discuss.elastic.co/t/stop-words-not-indexed-custom-edgengram-analyzer-with-not-stop-filter/7587/2 "2012-05-09T09:19:47Z")

</div>

Your search analyzer is the standard analyzer, so it will run on your text  
you provide as the query, and remove stopwords from it.

On Mon, May 7, 2012 at 11:04 PM, Robin Boutros [niuage@gmail.com](mailto:niuage@gmail.com) wrote:

> Hey,
> 
> That's how I define my mapping with Tire:
> 
> settings :analysis =\> {  
> :filter =\> {  
> :title\_ngram =\> {  
> type: "edgeNGram",  
> side: "front",  
> max\_gram: 15,  
> min\_gram: 1  
> }  
> },  
> tokenizer: {  
> title\_tokenizer: {  
> pattern: "[^\p{L}\d]+",  
> type: "pattern"  
> }  
> },  
> :analyzer =\> {  
> _:ngram\_analyzer_ =\> {  
> tokenizer: "title\_tokenizer",  
> _filter: ["lowercase", "title\_ngram"],_  
> type: "custom"  
> }  
> }  
> } do  
> mapping do  
> indexes :id, type: 'integer'  
> indexes :title, type: 'string', analyzer: 'snowball'  
> indexes :description, type: 'string', analyzer: 'snowball'  
> indexes :small\_photo, index: :not\_analyzed  
> _indexes :ngram\_title, :type =\> 'string', :index\_analyzer =\>  
> "ngram\_analyzer", search\_analyzer: "standard"_  
> end  
> end
> 
> I have 2 documents: "The Tree" and "Isnogood".
> 
> When I search for "th", "The Tree" is found. With "The", it's not.  
> When I search for "i", "Isnogood" is found. With "is", it's not.
> 
> Why arent stop words indexed? There is no "stop" filter for the  
> ngram\_analyzer...
> 
> 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:29am UTC](https://discuss.elastic.co/t/stop-words-not-indexed-custom-edgengram-analyzer-with-not-stop-filter/7587/3 "2017-07-06T03:29:41Z")

</div>


