# Indexing same field as both analyzed and not\_analyzed to \_all

**URL:** <https://discuss.elastic.co/t/indexing-same-field-as-both-analyzed-and-not-analyzed-to--all/13869>\
**Category:** Elasticsearch\
**Created:** [October 7, 2013, 4:46pm UTC](https://discuss.elastic.co/t/indexing-same-field-as-both-analyzed-and-not-analyzed-to--all/13869 "2013-10-07T16:46:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srividhya\_Umashanker](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Srividhya\_Umashanker](https://discuss.elastic.co/u/Srividhya_Umashanker)\
**Post date:** [October 7, 2013, 4:46pm UTC](https://discuss.elastic.co/t/indexing-same-field-as-both-analyzed-and-not-analyzed-to--all/13869/1 "2013-10-07T16:46:50Z")

</div>

Group -

In our current Lucene based framework, we have a need to index fields to  
\_all both as analyzed (standard) and not\_analysed.  
I understand that i can use multi\_field to add it to 2 different fields

"type" : "multi\_field",  
"fields" : {  
"name" : {  
"type" : "string",  
"index" : "analyzed",  
"index\_analyzer" :"keyword\_lowercase"  
},  
"actual" :  
{  
"type" : "string",  
"store" : "yes",  
"index" : "not\_analyzed"  
}  
}

2 Questions.

_1. Can I configure \_all as a multi\_field ?_  
_2. Is it possible to i use the same name twice to index 2 different data_

```
 "type" : "multi_field",
 "fields" : {
    *"name"* : {
 "type" : "string", 
 *"index" : "analyzed",*

```

},  
_"name"_ :  
{  
"type" : "string",  
"store" : "yes",  
_"index" : "not\_analyzed"_  
}  
}  
The requirement is to index both analyzed and not\_analyzed data to the  
\_all fields.

-Vidhya

--  
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:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 7, 2013, 5:17pm UTC](https://discuss.elastic.co/t/indexing-same-field-as-both-analyzed-and-not-analyzed-to--all/13869/2 "2013-10-07T17:17:58Z")

</div>

1. You can not turn \_all into multi field.

2. Nevertheless, you can set up a custom analyzer for \_all, and with a  
token filter, you can add stemmed (= analyzed) plus unstemmed (= not  
analyzed) words to the \_all field with the KeywordRepeaterFilter

Discussion [https://groups.google.com/forum/#!topic/elasticsearch/WUF4DZxYCxs](https://groups.google.com/forum/#!topic/elasticsearch/WUF4DZxYCxs)

Lucene issue: [https://issues.apache.org/jira/browse/LUCENE-4817](https://issues.apache.org/jira/browse/LUCENE-4817)

ES docs:  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-keyword-repeat-tokenfilter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-keyword-repeat-tokenfilter.html)

Jörg

--  
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:13am UTC](https://discuss.elastic.co/t/indexing-same-field-as-both-analyzed-and-not-analyzed-to--all/13869/3 "2017-07-06T02:13:24Z")

</div>


