# Can anyone please explain the mapping in Elasticsearch?

**URL:** <https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481>\
**Category:** Elasticsearch\
**Created:** [January 29, 2014, 5:36pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481 "2014-01-29T17:36:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dark\_shadow](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dark\_shadow](https://discuss.elastic.co/u/dark_shadow)\
**Post date:** [January 29, 2014, 5:36pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/1 "2014-01-29T17:36:26Z")

</div>

Hi,

I have an existing mapping with me but I'm not able to understand it fully.

curl -XPUT '[http://localhost:9200/auto\_index/](http://localhost:9200/auto_index/)[http://localhost:9200/acqindex/](http://localhost:9200/acqindex/)'  
-d '{  
"settings" : {  
"index" : {  
"number\_of\_shards" : 1,  
"number\_of\_replicas" : 1,  
"analysis" : {  
"analyzer" : {  
"str\_search\_analyzer" : {  
"tokenizer" : "standard",  
"filter" :  
["lowercase","asciifolding","suggestion\_shingle","edgengram"]  
},  
"str\_index\_analyzer" : {  
"tokenizer" : "standard",  
"filter" :  
["lowercase","asciifolding","suggestions\_shingle","edgengram"]  
}  
},  
"filter" : {  
"suggestions\_shingle": {  
"type": "shingle",  
"min\_shingle\_size": 2,  
"max\_shingle\_size": 5  
},  
"edgengram" : {  
"type" : "edgeNGram",  
"min\_gram" : 2,  
"max\_gram" : 30,  
"side" : "front"  
}  
}  
},  
"similarity" : {  
"index": {  
"type": "default"  
},  
"search": {  
"type": "default"  
}  
}  
}  
}

curl -XPUT 'localhost:9200/auto\_index/autocomplete/\_mapping' -d '{  
"autocomplete":{  
"\_boost" : {  
"name" : "po",  
"null\_value" : 4.0  
},  
"properties": {  
"ad": {  
"type": "string",  
"search\_analyzer" : "str\_search\_analyzer",  
"index\_analyzer" : "str\_index\_analyzer",  
"omit\_norms": "true",  
"similarity": "index"  
},  
"category": {  
"type": "string",  
"include\_in\_all" : false  
},  
"cn": {  
"type": "string",  
"search\_analyzer" : "str\_search\_analyzer",  
"index\_analyzer" : "str\_index\_analyzer",  
"omit\_norms": "true",  
"similarity": "index"  
},  
"ctype": {  
"type": "string",  
"search\_analyzer" : "keyword",  
"index\_analyzer" : "keyword",  
"omit\_norms": "true",  
"similarity": "index"  
},  
"eid": {  
"type": "string",  
"include\_in\_all" : false  
},  
"st": {  
"type": "string",  
"search\_analyzer" : "str\_search\_analyzer",  
"index\_analyzer" : "str\_index\_analyzer",  
"omit\_norms": "true",  
"similarity": "index"  
},  
"co": {  
"type": "string",  
"include\_in\_all" : false  
},  
"st": {  
"type": "string",  
"search\_analyzer" : "str\_search\_analyzer",  
"index\_analyzer" : "str\_index\_analyzer",  
"omit\_norms": "true",  
"similarity": "index"  
},  
"co": {  
"type": "string",  
"search\_analyzer" : "str\_search\_analyzer",  
"index\_analyzer" : "str\_index\_analyzer",  
"omit\_norms": "true",  
"similarity": "index"  
},  
"po": {  
"type": "double",  
"boost": 4.0  
},  
"en":{  
"type": "boolean"  
},  
"\_oid":{  
"type": "long"  
},  
"text": {  
"type": "string",  
"search\_analyzer" : "str\_search\_analyzer",  
"index\_analyzer" : "str\_index\_analyzer",  
"omit\_norms": "true",  
"similarity": "index"  
},  
"url": {  
"type": "string"  
}  
}  
}  
}'

I'm not able to understand how the index and search analyzer works exactly.  
Let's say I have following documents with me:-

{text:hotels in hosur}  
{text:hotels in innsburg}  
{text: hotels in mp}  
{text: hotels in ink}  
{text:hotels in ranchi}

Now If I query for 'hotels in' then I get hotels in hosur on the top. Is it  
because I have more occurrences of ho i the doc.

Can anyone please explain me with some sample sentence like how exactly my  
query string is getting analyzed ?

Thanks

--  
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/b02e1c23-18d2-4adc-b50b-8eecc00fac22%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b02e1c23-18d2-4adc-b50b-8eecc00fac22%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:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [January 29, 2014, 6:22pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/2 "2014-01-29T18:22:43Z")

</div>

Coder,

The best way to understand what an analyzer is doing is by using the  
\_analyze api. For example if you do something like this:

curl -XGET  
'[http://localhost:9200/auto\_index/\_analyze?analyzer=str\_search\_analyzer&pretty&text=hotels%20in%20hosur](http://localhost:9200/auto_index/_analyze?analyzer=str_search_analyzer&pretty&text=hotels%20in%20hosur)'

It will tell you how that text is analyzed. In your mapping, the analyzer  
does suggestions\_shingle and edgengram. The suggestions\_shingle does the  
shingle token filter  
([http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html))  
so for example:

"hotels in hosur" becomes "hotels", "in", "hosur", "hotels in", "hotels in  
hosur", "in hosur"

Then your edgengram does the edge ngram token filter  
([http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-edgengram-tokenizer.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-edgengram-tokenizer.html))  
so for example:

"hotels" becomes "ho", "hot", "hote", etc...  
"in" becomes "in"  
"hosur" becomes "ho", "hos", "hosu", etc...  
etc...

--  
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/1e8826a3-ccb9-4987-9372-88c3967b7d68%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1e8826a3-ccb9-4987-9372-88c3967b7d68%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:** ![dark\_shadow](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dark\_shadow](https://discuss.elastic.co/u/dark_shadow)\
**Post date:** [January 29, 2014, 6:36pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/3 "2014-01-29T18:36:49Z")

</div>

Binh,

I have a doubt in the above explanation. You mentioned that after  
suggestions\_shingle:  
"hotels in hosur" becomes "hotels", "in", "hosur", "hotels in", "hotels in  
hosur", "in hosur" but shouldn't be "hotels" , "in", "hosur" should be  
removed since my min\_shingle\_size is 2 or is it like the original tokens  
will stay always.

Also, after edgengram-tokenizer I'm getting "ho" many times so in my final  
output will there be only one "ho" ? or multiple "ho" because by default  
after every filter "unique" token filter is used by Elasticsearch, please  
correct me if I'm wrong ? How can I use unique token filter to remove the  
repeated tokens after final processing ? I tried adding "unique" after  
"edgengram" but it is not working ?

On Wed, Jan 29, 2014 at 11:52 PM, Binh Ly [binh@hibalo.com](mailto:binh@hibalo.com) wrote:

> Coder,
> 
> The best way to understand what an analyzer is doing is by using the  
> \_analyze api. For example if you do something like this:
> 
> curl -XGET '  
> [http://localhost:9200/auto\_index/\_analyze?analyzer=str\_search\_analyzer&pretty&text=hotels%20in%20hosur](http://localhost:9200/auto_index/_analyze?analyzer=str_search_analyzer&pretty&text=hotels%20in%20hosur)  
> '
> 
> It will tell you how that text is analyzed. In your mapping, the analyzer  
> does suggestions\_shingle and edgengram. The suggestions\_shingle does the  
> shingle token filter (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html))  
> so for example:
> 
> "hotels in hosur" becomes "hotels", "in", "hosur", "hotels in", "hotels in  
> hosur", "in hosur"
> 
> Then your edgengram does the edge ngram token filter (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-edgengram-tokenizer.html))  
> so for example:
> 
> "hotels" becomes "ho", "hot", "hote", etc...  
> "in" becomes "in"  
> "hosur" becomes "ho", "hos", "hosu", etc...  
> etc...
> 
> --  
> 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/1e8826a3-ccb9-4987-9372-88c3967b7d68%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1e8826a3-ccb9-4987-9372-88c3967b7d68%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/CAAVTvp6HK4\_iWQC\_hMwKijLBGNRXUa3CcHW\_YeTFSH1MYBDEyw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAVTvp6HK4_iWQC_hMwKijLBGNRXUa3CcHW_YeTFSH1MYBDEyw%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:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [January 29, 2014, 6:46pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/4 "2014-01-29T18:46:38Z")

</div>

Coder,

1. For the shingle token filter, there is a property called output\_unigrams  
which is true by default. What it does is it will output the single tokens:  
"hotels", "in", etc in addition to the shingle tokens. If you set it to  
false, it will remove them.

2. Correct, it will output "ho" many times because for each token that  
comes out of the shingles, it will do a edge ngram on it. I'm not familiar  
with the unique token filter but I will check and get back to 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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/08d19dd6-896c-40d2-a27a-7554f216ca4c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/08d19dd6-896c-40d2-a27a-7554f216ca4c%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:** ![dark\_shadow](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dark\_shadow](https://discuss.elastic.co/u/dark_shadow)\
**Post date:** [January 29, 2014, 8:18pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/5 "2014-01-29T20:18:18Z")

</div>

Binh,

I have one more doubt regarding matching of index time tokens with query  
time tokens. Can you please tell me how elasticsearch does this type of  
matching ? Is it like it only matches the token or it also matches other  
information like start\_offset, end\_offset, type and position. ?

Thanks

On Thu, Jan 30, 2014 at 12:16 AM, Binh Ly [binh@hibalo.com](mailto:binh@hibalo.com) wrote:

> Coder,
> 
> 1. For the shingle token filter, there is a property called  
> output\_unigrams which is true by default. What it does is it will output  
> the single tokens: "hotels", "in", etc in addition to the shingle tokens.  
> If you set it to false, it will remove them.
> 
> 2. Correct, it will output "ho" many times because for each token that  
> comes out of the shingles, it will do a edge ngram on it. I'm not familiar  
> with the unique token filter but I will check and get back to 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/08d19dd6-896c-40d2-a27a-7554f216ca4c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/08d19dd6-896c-40d2-a27a-7554f216ca4c%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/CAAVTvp6ng-q%2BAUe8vC2HpTp6-bMsdgXStAFzG4HYzDTVX2E9rg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAVTvp6ng-q%2BAUe8vC2HpTp6-bMsdgXStAFzG4HYzDTVX2E9rg%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:** ![dark\_shadow](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dark\_shadow](https://discuss.elastic.co/u/dark_shadow)\
**Post date:** [January 29, 2014, 8:19pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/6 "2014-01-29T20:19:46Z")

</div>

Also, are there any conditional token filtering can be done in  
Elasticsearch. Let's say I want some of my documents to be tokenized with a  
certain set of token filters whereas others to be indexed using some other  
set of token filters.

Thanks

On Thu, Jan 30, 2014 at 1:48 AM, Mukul Gupta [mukulnitkkr@gmail.com](mailto:mukulnitkkr@gmail.com) wrote:

> Binh,
> 
> I have one more doubt regarding matching of index time tokens with query  
> time tokens. Can you please tell me how elasticsearch does this type of  
> matching ? Is it like it only matches the token or it also matches other  
> information like start\_offset, end\_offset, type and position. ?
> 
> Thanks
> 
> On Thu, Jan 30, 2014 at 12:16 AM, Binh Ly [binh@hibalo.com](mailto:binh@hibalo.com) wrote:
> 
> > Coder,
> > 
> > 1. For the shingle token filter, there is a property called  
> > output\_unigrams which is true by default. What it does is it will output  
> > the single tokens: "hotels", "in", etc in addition to the shingle tokens.  
> > If you set it to false, it will remove them.
> > 
> > 2. Correct, it will output "ho" many times because for each token that  
> > comes out of the shingles, it will do a edge ngram on it. I'm not familiar  
> > with the unique token filter but I will check and get back to 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/08d19dd6-896c-40d2-a27a-7554f216ca4c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/08d19dd6-896c-40d2-a27a-7554f216ca4c%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/CAAVTvp5Yxrc0rAc0iqNXugEXmY%2BRYH3zuqDA69Akn4acSBmsBg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAVTvp5Yxrc0rAc0iqNXugEXmY%2BRYH3zuqDA69Akn4acSBmsBg%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:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [January 29, 2014, 9:12pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/7 "2014-01-29T21:12:38Z")

</div>

Coder,

In general, full-text searches match tokens. If you're doing phrase or span  
queries, it will also look at positions. If you're doing range queries,  
like date-range, or numeric range, then it will also look at the actual  
types.

On Wednesday, January 29, 2014 3:18:18 PM UTC-5, coder wrote:

> Binh,
> 
> I have one more doubt regarding matching of index time tokens with query  
> time tokens. Can you please tell me how elasticsearch does this type of  
> matching ? Is it like it only matches the token or it also matches other  
> information like start\_offset, end\_offset, type and position. ?
> 
> Thanks

--  
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/0ea8ec61-7040-447e-b75f-77f0513f3cc9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0ea8ec61-7040-447e-b75f-77f0513f3cc9%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:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [January 29, 2014, 9:16pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/8 "2014-01-29T21:16:10Z")

</div>

Analysis is done on a per-field basis. I do not believe you can  
conditionally change the analyzer for a single field depending on the  
nature of your data. However, you may be interested in the multi\_field type  
which allows you define multiple analyzers for a single field.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On Wednesday, January 29, 2014 3:19:46 PM UTC-5, coder wrote:

> Also, are there any conditional token filtering can be done in  
> Elasticsearch. Let's say I want some of my documents to be tokenized with a  
> certain set of token filters whereas others to be indexed using some other  
> set of token filters.
> 
> Thanks

--  
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/6bb01fbb-3394-4558-92e4-79aa8d7a84ea%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6bb01fbb-3394-4558-92e4-79aa8d7a84ea%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:** ![dark\_shadow](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dark\_shadow](https://discuss.elastic.co/u/dark_shadow)\
**Post date:** [January 30, 2014, 3:09am UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/9 "2014-01-30T03:09:02Z")

</div>

Binh,

I want to use conditional analysis for one set of documents not the single  
field in those documents. So, it's like I'm analyzing my type A documents  
with a set of tokens and rest of the documents with a different set of  
tokens and filters. Is there any way by which I can do it ?

Thanks

On Thu, Jan 30, 2014 at 2:46 AM, Binh Ly [binh@hibalo.com](mailto:binh@hibalo.com) wrote:

> Analysis is done on a per-field basis. I do not believe you can  
> conditionally change the analyzer for a single field depending on the  
> nature of your data. However, you may be interested in the multi\_field type  
> which allows you define multiple analyzers for a single field.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-multi-field-type.html)
> 
> On Wednesday, January 29, 2014 3:19:46 PM UTC-5, coder wrote:
> 
> > Also, are there any conditional token filtering can be done in  
> > Elasticsearch. Let's say I want some of my documents to be tokenized with a  
> > certain set of token filters whereas others to be indexed using some other  
> > set of token filters.
> > 
> > Thanks
> > 
> > --  
> > 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/6bb01fbb-3394-4558-92e4-79aa8d7a84ea%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6bb01fbb-3394-4558-92e4-79aa8d7a84ea%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/CAAVTvp7rjxsOTJupZPq%3DesUtG0BcabQdRdyF7X7qrz%2BqnuAK1g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAVTvp7rjxsOTJupZPq%3DesUtG0BcabQdRdyF7X7qrz%2BqnuAK1g%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:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [January 30, 2014, 12:51pm UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/10 "2014-01-30T12:51:00Z")

</div>

You'll probably want two different types with different mappings. So for  
example some documents will go under "[http://localhost:9200/yourdata/typea](http://localhost:9200/yourdata/typea)"  
and other documents will go under "[http://localhost:9200/yourdata/typeb](http://localhost:9200/yourdata/typeb)".  
Each one of these types can have its own independent mapping. You can query  
all your documents using "[http://localhost:9200/yourdata/\_search](http://localhost:9200/yourdata/_search)".

On Wednesday, January 29, 2014 10:09:02 PM UTC-5, coder wrote:

> Binh,
> 
> I want to use conditional analysis for one set of documents not the single  
> field in those documents. So, it's like I'm analyzing my type A documents  
> with a set of tokens and rest of the documents with a different set of  
> tokens and filters. Is there any way by which I can do it ?
> 
> Thanks

--  
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/e1cbbb71-930e-4ad9-b037-f6daed1ee3d0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e1cbbb71-930e-4ad9-b037-f6daed1ee3d0%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:** ![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, 1:53am UTC](https://discuss.elastic.co/t/can-anyone-please-explain-the-mapping-in-elasticsearch/15481/11 "2017-07-06T01:53:57Z")

</div>


