Make fields not searchable in mapping

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.

Hey,

http://www.elasticsearch.org/guide/reference/mapping/core-types.html

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 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
Sent from the ElasticSearch Users mailing list archive at 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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.