# Analyzer help for facet fields

**URL:** https://discuss.elastic.co/t/analyzer-help-for-facet-fields/14887
**Category:** Elasticsearch
**Created:** [December 16, 2013, 2:31pm UTC](https://discuss.elastic.co/t/analyzer-help-for-facet-fields/14887 "2013-12-16T14:31:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![project2501](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@project2501](https://discuss.elastic.co/u/project2501)
#### Post date: [December 16, 2013, 2:31pm UTC](https://discuss.elastic.co/t/analyzer-help-for-facet-fields/14887/1 "2013-12-16T14:31:10Z")

</div>

Hi,  
I have some facet fields I don't want analyzed. E.g.

"dates": [  
"December 17, 1970"  
]

The facet comes back only "december" in lowercase and without the rest. Of  
course, this isn't useful.

I didn't see an analyzer in the docs that was just a "leave it as is"  
analyzer.

Also, I don't want lowercase facets either.

Thanks for any help!

🙂

--  
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/560f852c-5ee3-4a49-a318-29ed7f092ff5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/560f852c-5ee3-4a49-a318-29ed7f092ff5%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: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [December 16, 2013, 2:41pm UTC](https://discuss.elastic.co/t/analyzer-help-for-facet-fields/14887/2 "2013-12-16T14:41:52Z")

</div>

So don't analyze at all the field! 🙂  
Set "index": "not\_analyzed"

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#string](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#string)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 16 décembre 2013 at 15:31:13, project2501 ([darreng5150@gmail.com](mailto:darreng5150@gmail.com)) a écrit:

Hi,  
I have some facet fields I don't want analyzed. E.g.

"dates": [  
"December 17, 1970"  
]

The facet comes back only "december" in lowercase and without the rest. Of course, this isn't useful.

I didn't see an analyzer in the docs that was just a "leave it as is" analyzer.

Also, I don't want lowercase facets either.

Thanks for any help!

## 🙂

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/560f852c-5ee3-4a49-a318-29ed7f092ff5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/560f852c-5ee3-4a49-a318-29ed7f092ff5%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/etPan.52af1130.4353d0cd.6956%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.52af1130.4353d0cd.6956%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![project2501](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@project2501](https://discuss.elastic.co/u/project2501)
#### Post date: [December 16, 2013, 2:51pm UTC](https://discuss.elastic.co/t/analyzer-help-for-facet-fields/14887/3 "2013-12-16T14:51:58Z")

</div>

That works. Thank you. Still learning ES here. 🙂

On Monday, December 16, 2013 9:41:52 AM UTC-5, David Pilato wrote:

> So don't analyze at all the field! 🙂  
> Set "index": "not\_analyzed"
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#string)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 16 décembre 2013 at 15:31:13, project2501 ([darre...@gmail.com](mailto:darre...@gmail.com)\<javascript:\>)  
> a écrit:
> 
> Hi,  
> I have some facet fields I don't want analyzed. E.g.
> 
> "dates": [  
> "December 17, 1970"  
> ]
> 
> The facet comes back only "december" in lowercase and without the rest. Of  
> course, this isn't useful.
> 
> I didn't see an analyzer in the docs that was just a "leave it as is"  
> analyzer.
> 
> Also, I don't want lowercase facets either.
> 
> Thanks for any help!
> 
> ## 🙂
> 
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/560f852c-5ee3-4a49-a318-29ed7f092ff5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/560f852c-5ee3-4a49-a318-29ed7f092ff5%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/a37360e4-2a65-43aa-9135-e774261d0ca8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a37360e4-2a65-43aa-9135-e774261d0ca8%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: ![project2501](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@project2501](https://discuss.elastic.co/u/project2501)
#### Post date: [December 18, 2013, 1:59am UTC](https://discuss.elastic.co/t/analyzer-help-for-facet-fields/14887/4 "2013-12-18T01:59:24Z")

</div>

Now there is a similar problem from this.

I set my document field to be "not\_analyzed" for "places:

So I get

"places": [  
"This\_That",  
"Here\_and\_There"  
]

The facets come back exactly as you see them.

But now, I cannot search on those strings. I have to use string query.  
When I do "places:"This\_That" it says ZERO results.

If I do:

"places":"This That"

I get results as if "this OR that"

How can I indicate in a query string to not analyze this field? On a per  
query basis?

On Monday, December 16, 2013 9:51:58 AM UTC-5, project2501 wrote:

> That works. Thank you. Still learning ES here. 🙂
> 
> On Monday, December 16, 2013 9:41:52 AM UTC-5, David Pilato wrote:
> 
> > So don't analyze at all the field! 🙂  
> > Set "index": "not\_analyzed"
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#string)
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 16 décembre 2013 at 15:31:13, project2501 ([darre...@gmail.com](mailto:darre...@gmail.com)) a  
> > écrit:
> > 
> > Hi,  
> > I have some facet fields I don't want analyzed. E.g.
> > 
> > "dates": [  
> > "December 17, 1970"  
> > ]
> > 
> > The facet comes back only "december" in lowercase and without the rest.  
> > Of course, this isn't useful.
> > 
> > I didn't see an analyzer in the docs that was just a "leave it as is"  
> > analyzer.
> > 
> > Also, I don't want lowercase facets either.
> > 
> > Thanks for any help!
> > 
> > ## 🙂
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/560f852c-5ee3-4a49-a318-29ed7f092ff5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/560f852c-5ee3-4a49-a318-29ed7f092ff5%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/6e462f96-e8a6-462c-bbad-30db61d0d5ec%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6e462f96-e8a6-462c-bbad-30db61d0d5ec%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, 2:00am UTC](https://discuss.elastic.co/t/analyzer-help-for-facet-fields/14887/5 "2017-07-06T02:00:32Z")

</div>


