# How to index stop words AND special characters using standard analyzer

**URL:** <https://discuss.elastic.co/t/how-to-index-stop-words-and-special-characters-using-standard-analyzer/14808>\
**Category:** Elasticsearch\
**Created:** [December 11, 2013, 8:07am UTC](https://discuss.elastic.co/t/how-to-index-stop-words-and-special-characters-using-standard-analyzer/14808 "2013-12-11T08:07:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sowjanya](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@sowjanya](https://discuss.elastic.co/u/sowjanya)\
**Post date:** [December 11, 2013, 8:07am UTC](https://discuss.elastic.co/t/how-to-index-stop-words-and-special-characters-using-standard-analyzer/14808/1 "2013-12-11T08:07:11Z")

</div>

Hi,  
I need to index stop words AND Special characters with the features of  
Standard Analyzer.

I have the mapping like this  
{  
"abc\_template" : {  
"template" : "\*",  
"order": 0,  
"settings" :{

},  
"mappings" : {  
"_default_" : {  
"\_source" : {"enabled" : true },  
"\_all" : {"enabled" : false },  
"\_timestamp" : {"enabled" : true, "store" : "yes"},  
"abc\_record\_id" : {"type" : "string", "store" : "yes", "index" :  
"not\_analyzed"},  
"abc\_object\_name" : {"type" : "string", "store" : "yes", "index" :  
"not\_analyzed"},  
"abc\_field\_name" : {"type" : "string", "store" : "yes", "index" :  
"not\_analyzed"}  
}  
}  
}  
}

_And it automatically considering "text" as default field. We need to index  
stop words and special characters for field "text"._

Please help me.

Thanks In Advance.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/79176818-bc80-41ec-99e4-0b83616c70af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/79176818-bc80-41ec-99e4-0b83616c70af%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [December 11, 2013, 8:42pm UTC](https://discuss.elastic.co/t/how-to-index-stop-words-and-special-characters-using-standard-analyzer/14808/2 "2013-12-11T20:42:00Z")

</div>

You would need to create a custom analyzer (using the elasticsearch syntax)  
that is identical to the standard analyzer, but without the stop filter and  
extra analysis.

Here is the code for the standard analyzer:  
[http://grepcode.com/file/repo1.maven.org/maven2/org.apache.lucene/lucene-analyzers-common/4.3.1/org/apache/lucene/analysis/standard/StandardAnalyzer.java#110](http://grepcode.com/file/repo1.maven.org/maven2/org.apache.lucene/lucene-analyzers-common/4.3.1/org/apache/lucene/analysis/standard/StandardAnalyzer.java#110)

IIRC, you should be fine with the standard tokenizer and we just need to  
remove the standard and stop filter. Just create a custom analyzer and use  
the analysis API to debug it.

Cheers,

Ivan

On Wed, Dec 11, 2013 at 12:07 AM, Elastic Sowjanya \<[sowjanyachalla@gmail.com](mailto:sowjanyachalla@gmail.com)

> wrote:

> Hi,  
> I need to index stop words AND Special characters with the features of  
> Standard Analyzer.
> 
> I have the mapping like this  
> {  
> "abc\_template" : {  
> "template" : "\*",  
> "order": 0,  
> "settings" :{
> 
> },  
> "mappings" : {  
> "_default_" : {  
> "\_source" : {"enabled" : true },  
> "\_all" : {"enabled" : false },  
> "\_timestamp" : {"enabled" : true, "store" : "yes"},  
> "abc\_record\_id" : {"type" : "string", "store" : "yes", "index" :  
> "not\_analyzed"},  
> "abc\_object\_name" : {"type" : "string", "store" : "yes", "index" :  
> "not\_analyzed"},  
> "abc\_field\_name" : {"type" : "string", "store" : "yes", "index" :  
> "not\_analyzed"}  
> }  
> }  
> }  
> }
> 
> _And it automatically considering "text" as default field. We need to  
> index stop words and special characters for field "text"._
> 
> Please help me.
> 
> Thanks In Advance.
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/79176818-bc80-41ec-99e4-0b83616c70af%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/79176818-bc80-41ec-99e4-0b83616c70af%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAixify%3DF63UvwMgUtee9kni6F0C52Qam6%2BN-5zrLp2rA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAixify%3DF63UvwMgUtee9kni6F0C52Qam6%2BN-5zrLp2rA%40mail.gmail.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:01am UTC](https://discuss.elastic.co/t/how-to-index-stop-words-and-special-characters-using-standard-analyzer/14808/3 "2017-07-06T02:01:54Z")

</div>


