# Confused about facets in elasticsearch

**URL:** <https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209>\
**Category:** Elasticsearch\
**Created:** [April 10, 2011, 10:40pm UTC](https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209 "2011-04-10T22:40:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saumya\_Garg](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Saumya\_Garg](https://discuss.elastic.co/u/Saumya_Garg)\
**Post date:** [April 10, 2011, 10:40pm UTC](https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209/1 "2011-04-10T22:40:31Z")

</div>

I am trying to figure out the facet query language:

I see the following example in the doc ---\>

{  
"facets" : {  
"wow\_facet" : {  
"query" : {  
"term" : { "tag" : "wow" }  
}  
}  
}  
}

In the above example:

What is wow\_facet?  
What is tag?

Is their any special quirks about the indexing process for facets? Or  
can you turn any field you have have indexed into a facet field?

Thanks,

Saumya

---

<div class="post-metadata">

**Author:** ![Saumya\_Garg](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Saumya\_Garg](https://discuss.elastic.co/u/Saumya_Garg)\
**Post date:** [April 10, 2011, 11:21pm UTC](https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209/2 "2011-04-10T23:21:09Z")

</div>

I think I figured it out what I needed from the following page:

e class="onebox allowlistedgeneric" data-onebox-src="https://www.elastic.co"\> ![](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fafcd8eb1c830dfbcdee1be8ac38b7bcfdce1c45.png)[Elastic](https://www.elastic.co)

 ![](https://us1.discourse-cdn.com/elastic/optimized/3X/2/b/2b3f8a2d05f105dfdd4d4ec365ae82641744fc24_2_690x360.png)

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

I am still unsure about facet filters... Having an example on the  
facet\_filters page where we can see what information is first stored and  
how that information is stored before the facet filter query example  
would help clarify.

Saumya

On 04/10/2011 05:40 PM, Saumya Garg wrote:

> I am trying to figure out the facet query language:
> 
> I see the following example in the doc ---\>
> 
> {  
> "facets" : {  
> "wow\_facet" : {  
> "query" : {  
> "term" : { "tag" : "wow" }  
> }  
> }  
> }  
> }
> 
> In the above example:
> 
> What is wow\_facet?  
> What is tag?
> 
> Is their any special quirks about the indexing process for facets? Or  
> can you turn any field you have have indexed into a facet field?
> 
> Thanks,
> 
> Saumya

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 11, 2011, 8:22am UTC](https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209/3 "2011-04-11T08:22:42Z")

</div>

Stored? I don't understand the question.. . Its so simply to experiment with elasticsearch, just fire up your shell, index some docs with curl, and see how it works. And the search filter has a complete example, it can't get more "exampled" than this, just try it out.  
On Monday, April 11, 2011 at 2:21 AM, Saumya Garg wrote:

> I think I figured it out what I needed from the following page:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/filter.html)
> 
> I am still unsure about facet filters... Having an example on the  
> facet\_filters page where we can see what information is first stored and  
> how that information is stored before the facet filter query example  
> would help clarify.
> 
> Saumya
> 
> On 04/10/2011 05:40 PM, Saumya Garg wrote:
> 
> > I am trying to figure out the facet query language:
> > 
> > I see the following example in the doc ---\>
> > 
> > {  
> > "facets" : {  
> > "wow\_facet" : {  
> > "query" : {  
> > "term" : { "tag" : "wow" }  
> > }  
> > }  
> > }  
> > }
> > 
> > In the above example:
> > 
> > What is wow\_facet?  
> > What is tag?
> > 
> > Is their any special quirks about the indexing process for facets? Or  
> > can you turn any field you have have indexed into a facet field?
> > 
> > Thanks,
> > 
> > Saumya

---

<div class="post-metadata">

**Author:** ![karmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karmi/32/44951_2.png) [@karmi](https://discuss.elastic.co/u/karmi)\
**Post date:** [April 11, 2011, 12:02pm UTC](https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209/4 "2011-04-11T12:02:44Z")

</div>

I think the documentation could be more clear here, I've set a ticket  
for it; [https://github.com/elasticsearch/elasticsearch.github.com/issues/24](https://github.com/elasticsearch/elasticsearch.github.com/issues/24)

On Apr 11, 1:21 am, Saumya Garg [sgargconsult...@gmail.com](mailto:sgargconsult...@gmail.com) wrote:

> I think I figured it out what I needed from the following page:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/filter.html)
> 
> I am still unsure about facet filters... Having an example on the  
> facet\_filters page where we can see what information is first stored and  
> how that information is stored before the facet filter query example  
> would help clarify.
> 
> Saumya
> 
> On 04/10/2011 05:40 PM, Saumya Garg wrote:
> 
> > I am trying to figure out the facet query language:
> 
> > I see the following example in the doc ---\>
> 
> > {  
> > "facets" : {  
> > "wow\_facet" : {  
> > "query" : {  
> > "term" : { "tag" : "wow" }  
> > }  
> > }  
> > }  
> > }
> 
> > In the above example:
> 
> > What is wow\_facet?  
> > What is tag?
> 
> > Is their any special quirks about the indexing process for facets? Or  
> > can you turn any field you have have indexed into a facet field?
> 
> > Thanks,
> 
> > Saumya

---

<div class="post-metadata">

**Author:** ![karmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karmi/32/44951_2.png) [@karmi](https://discuss.elastic.co/u/karmi)\
**Post date:** [April 13, 2011, 9:39am UTC](https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209/5 "2011-04-13T09:39:13Z")

</div>

Could you check out this version

> <https://github.com/karmi/elasticsearch.github.com/blob/a70edc634c349969769ebf4337e429b0bb1f9a97/guide/reference/api/search/facets/index.textile>

? Is it any better?

On Apr 11, 1:21 am, Saumya Garg [sgargconsult...@gmail.com](mailto:sgargconsult...@gmail.com) wrote:

> I think I figured it out what I needed from the following page:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/filter.html)
> 
> I am still unsure about facet filters... Having an example on the  
> facet\_filters page where we can see what information is first stored and  
> how that information is stored before the facet filter query example  
> would help clarify.
> 
> Saumya
> 
> On 04/10/2011 05:40 PM, Saumya Garg wrote:
> 
> > I am trying to figure out the facet query language:
> 
> > I see the following example in the doc ---\>
> 
> > {  
> > "facets" : {  
> > "wow\_facet" : {  
> > "query" : {  
> > "term" : { "tag" : "wow" }  
> > }  
> > }  
> > }  
> > }
> 
> > In the above example:
> 
> > What is wow\_facet?  
> > What is tag?
> 
> > Is their any special quirks about the indexing process for facets? Or  
> > can you turn any field you have have indexed into a facet field?
> 
> > Thanks,
> 
> > Saumya

---

<div class="post-metadata">

**Author:** ![jacorob](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jacorob](https://discuss.elastic.co/u/jacorob)\
**Post date:** [April 13, 2011, 7:26pm UTC](https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209/6 "2011-04-13T19:26:26Z")

</div>

Karel,

Regardless of whether it helped the original poster, it helped me. Thanks!

Bob

On Wed, Apr 13, 2011 at 4:39 AM, Karel Minarik [karel.minarik@gmail.com](mailto:karel.minarik@gmail.com)wrote:

> Could you check out this version
> 
> [https://github.com/karmi/elasticsearch.github.com/blob/a70edc634c349969769ebf4337e429b0bb1f9a97/guide/reference/api/search/facets/index.textile](https://github.com/karmi/elasticsearch.github.com/blob/a70edc634c349969769ebf4337e429b0bb1f9a97/guide/reference/api/search/facets/index.textile)  
> ? Is it any better?
> 
> On Apr 11, 1:21 am, Saumya Garg [sgargconsult...@gmail.com](mailto:sgargconsult...@gmail.com) wrote:
> 
> > I think I figured it out what I needed from the following page:
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/filter.html)
> > 
> > I am still unsure about facet filters... Having an example on the  
> > facet\_filters page where we can see what information is first stored and  
> > how that information is stored before the facet filter query example  
> > would help clarify.
> > 
> > Saumya
> > 
> > On 04/10/2011 05:40 PM, Saumya Garg wrote:
> > 
> > > I am trying to figure out the facet query language:
> > 
> > > I see the following example in the doc ---\>
> > 
> > > {  
> > > "facets" : {  
> > > "wow\_facet" : {  
> > > "query" : {  
> > > "term" : { "tag" : "wow" }  
> > > }  
> > > }  
> > > }  
> > > }
> > 
> > > In the above example:
> > 
> > > What is wow\_facet?  
> > > What is tag?
> > 
> > > Is their any special quirks about the indexing process for facets? Or  
> > > can you turn any field you have have indexed into a facet field?
> > 
> > > Thanks,
> > 
> > > Saumya

---

<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, 4:08am UTC](https://discuss.elastic.co/t/confused-about-facets-in-elasticsearch/4209/7 "2017-07-06T04:08:22Z")

</div>


