# Make fields not searchable in mapping

**URL:** https://discuss.elastic.co/t/make-fields-not-searchable-in-mapping/11121
**Category:** Elasticsearch
**Created:** [March 13, 2013, 2:22am UTC](https://discuss.elastic.co/t/make-fields-not-searchable-in-mapping/11121 "2013-03-13T02:22:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![extravio](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@extravio](https://discuss.elastic.co/u/extravio)
#### Post date: [March 13, 2013, 2:22am UTC](https://discuss.elastic.co/t/make-fields-not-searchable-in-mapping/11121/1 "2013-03-13T02:22:43Z")

</div>

Hi,  
Let's say I have a list of items and categories.  
1: name: BLUE DUCK, category: BLUE  
2: name: RED DUCK, category: RED  
3: name: DAFFY, category: DUCK  
I want to index the items' names and categories but I don't want the "category" to be searchable, as it would not return anything relevant.  
So if I search for DUCK, the result will be BLUE DUCK (BLUE) + RED DUCK (RED), but DAFFY will not be included. Then I'd like to be able to use the category in a facet to filter blue or red.

Is there a way to configure that in the mapping?  
My real-life case scenario is obviously more complicated and I can't just specify "name:DUCK" in the query string.  
How can I solve that problem?  
Cheers.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [March 14, 2013, 10:52am UTC](https://discuss.elastic.co/t/make-fields-not-searchable-in-mapping/11121/2 "2013-03-14T10:52:01Z")

</div>

Hey,

> **[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.

check the "index" attribute, if you want to configure a field not to be  
searchable at all via mapping. There might be different solutions  
preventing fields from being searchable, as usual it depends on your  
concrete use case.

On Wed, Mar 13, 2013 at 3:22 AM, extravio [mikaelmr@gmail.com](mailto:mikaelmr@gmail.com) wrote:

> Hi,  
> Let's say I have a list of items and categories.  
> 1: name: BLUE DUCK, category: BLUE  
> 2: name: RED DUCK, category: RED  
> 3: name: DAFFY, category: DUCK  
> I want to index the items' names and categories but I don't want the  
> "category" to be searchable, as it would not return anything relevant.  
> So if I search for DUCK, the result will be BLUE DUCK (BLUE) + RED DUCK  
> (RED), but DAFFY will not be included. Then I'd like to be able to use the  
> category in a facet to filter blue or red.
> 
> Is there a way to configure that in the mapping?  
> My real-life case scenario is obviously more complicated and I can't just  
> specify "name:DUCK" in the query string.  
> How can I solve that problem?  
> Cheers.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Make-fields-not-searchable-in-mapping-tp4031539.html](http://elasticsearch-users.115913.n3.nabble.com/Make-fields-not-searchable-in-mapping-tp4031539.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> 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).

--  
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:46am UTC](https://discuss.elastic.co/t/make-fields-not-searchable-in-mapping/11121/3 "2017-07-06T02:46:30Z")

</div>


