# Facet by entire field text

**URL:** <https://discuss.elastic.co/t/facet-by-entire-field-text/10045>\
**Category:** Elasticsearch\
**Created:** [December 11, 2012, 6:26pm UTC](https://discuss.elastic.co/t/facet-by-entire-field-text/10045 "2012-12-11T18:26:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kubes](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@Kubes](https://discuss.elastic.co/u/Kubes)\
**Post date:** [December 11, 2012, 6:26pm UTC](https://discuss.elastic.co/t/facet-by-entire-field-text/10045/1 "2012-12-11T18:26:44Z")

</div>

Hello,

Can one have a facet that is field based? The field is analyzed, but I  
dont want a terms facet. I would like to facet on the entire text of the  
field?

Thanks

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [December 11, 2012, 7:27pm UTC](https://discuss.elastic.co/t/facet-by-entire-field-text/10045/2 "2012-12-11T19:27:51Z")

</div>

You would need to set the field as multi-field, with one field set as  
non\_analyzed (or use the keyword analyzer). You can then use the term facet  
on this new field.

This change requires a re-index. Your current index does not have the  
proper tokens to create the facet you are looking for.

--  
Ivan

On Tue, Dec 11, 2012 at 10:26 AM, Kubes [philip@freepricealerts.com](mailto:philip@freepricealerts.com) wrote:

> Hello,
> 
> Can one have a facet that is field based? The field is analyzed, but I  
> dont want a terms facet. I would like to facet on the entire text of the  
> field?
> 
> Thanks
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Kubes](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@Kubes](https://discuss.elastic.co/u/Kubes)\
**Post date:** [December 11, 2012, 7:41pm UTC](https://discuss.elastic.co/t/facet-by-entire-field-text/10045/3 "2012-12-11T19:41:08Z")

</div>

Iva,

Thanks. So being new to Elasticsearch a few additional questions?

1. Setting field as multi-field is via a mapping, correct?
2. How does one re-index? My understanding was it cant be done?

On Tuesday, December 11, 2012 2:27:51 PM UTC-5, Ivan Brusic wrote:

> You would need to set the field as multi-field, with one field set as  
> non\_analyzed (or use the keyword analyzer). You can then use the term facet  
> on this new field.
> 
> This change requires a re-index. Your current index does not have the  
> proper tokens to create the facet you are looking for.
> 
> --  
> Ivan
> 
> On Tue, Dec 11, 2012 at 10:26 AM, Kubes \<[phi...@freepricealerts.com](mailto:phi...@freepricealerts.com)\<javascript:\>
> 
> > wrote:
> 
> > Hello,
> > 
> > Can one have a facet that is field based? The field is analyzed, but I  
> > dont want a terms facet. I would like to facet on the entire text of the  
> > field?
> > 
> > Thanks
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [December 11, 2012, 8:40pm UTC](https://discuss.elastic.co/t/facet-by-entire-field-text/10045/4 "2012-12-11T20:40:28Z")

</div>

Answers inline.

On Tue, Dec 11, 2012 at 11:41 AM, Kubes [philip@freepricealerts.com](mailto:philip@freepricealerts.com) wrote:

> Iva,
> 
> Thanks. So being new to Elasticsearch a few additional questions?
> 
> 1. Setting field as multi-field is via a mapping, correct?

Correct. Multi-field's main use case is exactly what you are looking for.  
Same field: one field analyzed, the other not.

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

1. How does one re-index? My understanding was it cant be done?

> 

Indexing is application dependent, so you would need to kick off  
whichever mechanism you have in place. I believe there is a reindexing  
plugin. Not sure, never used it.

Technically, you do not need to reindex, but only newer documents will have  
the mapping and contain both fields. When you have a facet over the new  
field, the older documents will not appear.

--  
Ivan

> On Tuesday, December 11, 2012 2:27:51 PM UTC-5, Ivan Brusic wrote:
> 
> > You would need to set the field as multi-field, with one field set as  
> > non\_analyzed (or use the keyword analyzer). You can then use the term facet  
> > on this new field.
> > 
> > This change requires a re-index. Your current index does not have the  
> > proper tokens to create the facet you are looking for.
> > 
> > --  
> > Ivan
> > 
> > On Tue, Dec 11, 2012 at 10:26 AM, Kubes [phi...@freepricealerts.com](mailto:phi...@freepricealerts.com)wrote:
> > 
> > > Hello,
> > > 
> > > Can one have a facet that is field based? The field is analyzed, but I  
> > > dont want a terms facet. I would like to facet on the entire text of the  
> > > field?
> > > 
> > > Thanks
> > > 
> > > --
> > 
> > --

--

---

<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, 3:00am UTC](https://discuss.elastic.co/t/facet-by-entire-field-text/10045/5 "2017-07-06T03:00:14Z")

</div>


