# Mapping issue?

**URL:** <https://discuss.elastic.co/t/mapping-issue/19574>\
**Category:** Elasticsearch\
**Created:** [September 2, 2014, 2:50pm UTC](https://discuss.elastic.co/t/mapping-issue/19574 "2014-09-02T14:50:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seb\_Emin](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Seb\_Emin](https://discuss.elastic.co/u/Seb_Emin)\
**Post date:** [September 2, 2014, 2:50pm UTC](https://discuss.elastic.co/t/mapping-issue/19574/1 "2014-09-02T14:50:10Z")

</div>

I'm storing search terms in ElasticSearch, and then trying to do things  
like find the top 5 search terms.

When I write queries to do this, instead of getting top 5 occurring search  
terms, I'm getting the top 5 occurring words.

For example:  
term1 = Tomb Raider: Temple of Light  
term2 = Tomb Raider 1  
term3 = Tomb Raider 2  
term4 = Tomb Raider: Chronicles  
term5 = Tomb Raider: Chronicles  
term6 = Tomb Raider: Chronicles

Instead of getting 'Tomb Raider: Chronicles' as a top occurring search  
term, I'm getting  
'Tomb' and 'Raider' as individual words. How do I get ES to query the  
entire field?

I've read all the docs and have looked at using not\_analyzed and then  
referring to term as term.raw in the query - but when I do this I just get  
an empty bucket returned.

Could anyone point me in the right direction? I have a feeling this might  
be a mapping issue.

--  
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/bc93f546-2ca4-4a57-b9b1-e7b3f9750992%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc93f546-2ca4-4a57-b9b1-e7b3f9750992%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)\
**Post date:** [September 2, 2014, 5:13pm UTC](https://discuss.elastic.co/t/mapping-issue/19574/2 "2014-09-02T17:13:31Z")

</div>

Hello Seb ,

Declaring it as not\_analyzed should do the trick.  
Can you paste the mapping you have applied.

Thanks  
Vineeth

On Tue, Sep 2, 2014 at 8:20 PM, Seb Emin [seb.emin@gmail.com](mailto:seb.emin@gmail.com) wrote:

> I'm storing search terms in Elasticsearch, and then trying to do things  
> like find the top 5 search terms.
> 
> When I write queries to do this, instead of getting top 5 occurring search  
> terms, I'm getting the top 5 occurring words.
> 
> For example:  
> term1 = Tomb Raider: Temple of Light  
> term2 = Tomb Raider 1  
> term3 = Tomb Raider 2  
> term4 = Tomb Raider: Chronicles  
> term5 = Tomb Raider: Chronicles  
> term6 = Tomb Raider: Chronicles
> 
> Instead of getting 'Tomb Raider: Chronicles' as a top occurring search  
> term, I'm getting  
> 'Tomb' and 'Raider' as individual words. How do I get ES to query the  
> entire field?
> 
> I've read all the docs and have looked at using not\_analyzed and then  
> referring to term as term.raw in the query - but when I do this I just get  
> an empty bucket returned.
> 
> Could anyone point me in the right direction? I have a feeling this might  
> be a mapping issue.
> 
> --  
> 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/bc93f546-2ca4-4a57-b9b1-e7b3f9750992%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc93f546-2ca4-4a57-b9b1-e7b3f9750992%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/bc93f546-2ca4-4a57-b9b1-e7b3f9750992%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bc93f546-2ca4-4a57-b9b1-e7b3f9750992%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAGdPd5mbxuMPTZyi\_mCe-5EjMczxw3vW863KN91EdhTno%2B\_mLA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mbxuMPTZyi_mCe-5EjMczxw3vW863KN91EdhTno%2B_mLA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:04am UTC](https://discuss.elastic.co/t/mapping-issue/19574/3 "2017-07-06T01:04:55Z")

</div>


