# What's the scope value of Facet?

**URL:** <https://discuss.elastic.co/t/whats-the-scope-value-of-facet/7561>\
**Category:** Elasticsearch\
**Created:** [May 4, 2012, 9:43am UTC](https://discuss.elastic.co/t/whats-the-scope-value-of-facet/7561 "2012-05-04T09:43:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yang](https://avatars.discourse-cdn.com/v4/letter/y/77aa72/32.png) [@Yang](https://discuss.elastic.co/u/Yang)\
**Post date:** [May 4, 2012, 9:43am UTC](https://discuss.elastic.co/t/whats-the-scope-value-of-facet/7561/1 "2012-05-04T09:43:09Z")

</div>

Hi all,

I'm playing ES, but here I meet a problem with facet: I don't know what  
value should I pass to field scope of Facet.

[http://www.elasticsearch.org/guide/reference/api/search/facets/](http://www.elasticsearch.org/guide/reference/api/search/facets/)

The page above just give a little info about scope, and also, I tried value  
"index", "type" and "document", but they don't work, no facet value return.  
Could anybody show me some reference?

That would be very helpful~~

## thanks,

Yang.

---

<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:** [May 4, 2012, 3:17pm UTC](https://discuss.elastic.co/t/whats-the-scope-value-of-facet/7561/2 "2012-05-04T15:17:41Z")

</div>

Hi Yang,

A field is any [non-analyzed] field in your document. The facet will  
place all the values into buckets and return the relevant results. In  
the example on the page you linked to, documents such as the following  
are created:

{  
"title": "One",  
"tags": [  
"foo"  
]  
}

The document contains two fields: title and tags. The latter is  
multi-valued (facets work on non-multivalued terms as well, just  
pointing out the notation). The facet then is used on the tags field.

Cheers,

Ivan

On Fri, May 4, 2012 at 2:43 AM, Yang [yuyang030405@gmail.com](mailto:yuyang030405@gmail.com) wrote:

> Hi all,
> 
> I'm playing ES, but here I meet a problem with facet: I don't know what  
> value should I pass to field scope of Facet.
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/facets/)
> 
> The page above just give a little info about scope, and also, I tried value  
> "index", "type" and "document", but they don't work, no facet value return.  
> Could anybody show me some reference?
> 
> That would be very helpful~~
> 
> ## thanks,
> 
> Yang.

---

<div class="post-metadata">

**Author:** ![Yang](https://avatars.discourse-cdn.com/v4/letter/y/77aa72/32.png) [@Yang](https://discuss.elastic.co/u/Yang)\
**Post date:** [May 5, 2012, 1:42pm UTC](https://discuss.elastic.co/t/whats-the-scope-value-of-facet/7561/3 "2012-05-05T13:42:21Z")

</div>

Hi Ivan,

Thanks very much, it is really helpful~

I got your point, and I'm trying it, it seems work now.

Again, thanks~~

--  
Yang

On Friday, May 4, 2012 11:17:41 PM UTC+8, Ivan Brusic wrote:

> Hi Yang,
> 
> A field is any [non-analyzed] field in your document. The facet will  
> place all the values into buckets and return the relevant results. In  
> the example on the page you linked to, documents such as the following  
> are created:
> 
> {  
> "title": "One",  
> "tags": [  
> "foo"  
> ]  
> }
> 
> The document contains two fields: title and tags. The latter is  
> multi-valued (facets work on non-multivalued terms as well, just  
> pointing out the notation). The facet then is used on the tags field.
> 
> Cheers,
> 
> Ivan
> 
> On Fri, May 4, 2012 at 2:43 AM, Yang [yuyang030405@gmail.com](mailto:yuyang030405@gmail.com) wrote:
> 
> > Hi all,
> > 
> > I'm playing ES, but here I meet a problem with facet: I don't know what  
> > value should I pass to field scope of Facet.
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/facets/)
> > 
> > The page above just give a little info about scope, and also, I tried  
> > value  
> > "index", "type" and "document", but they don't work, no facet value  
> > return.  
> > Could anybody show me some reference?
> > 
> > That would be very helpful~~
> > 
> > ## thanks,
> > 
> > Yang.

---

<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:30am UTC](https://discuss.elastic.co/t/whats-the-scope-value-of-facet/7561/4 "2017-07-06T03:30:00Z")

</div>

Closed on July 6, 2017, 3:30am UTC


