# All values for a given field

**URL:** <https://discuss.elastic.co/t/all-values-for-a-given-field/10793>\
**Category:** Elasticsearch\
**Created:** [February 19, 2013, 8:28am UTC](https://discuss.elastic.co/t/all-values-for-a-given-field/10793 "2013-02-19T08:28:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann\_Barraud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_barraud/32/1108_2.png) [@Yann\_Barraud](https://discuss.elastic.co/u/Yann_Barraud)\
**Post date:** [February 19, 2013, 8:28am UTC](https://discuss.elastic.co/t/all-values-for-a-given-field/10793/1 "2013-02-19T08:28:32Z")

</div>

Hi,

I'm trying to build an IHM (with elastic.js & d3.js), and whish to get all  
the values for a given field. Is it safe & efficient to use a match\_all  
query with term facet ?

Thanks.

Yann

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [February 19, 2013, 9:32am UTC](https://discuss.elastic.co/t/all-values-for-a-given-field/10793/2 "2013-02-19T09:32:33Z")

</div>

Hey,

what is a IHM? 🙂 Depending on the field you might return tons of values  
and facets will require to pass in a #size. if you oversize this to a large  
number you might run into problems quickly but if you only need a top N  
list this should be fine

simon

On Tuesday, February 19, 2013 9:28:32 AM UTC+1, Yann Barraud wrote:

> Hi,
> 
> I'm trying to build an IHM (with elastic.js & d3.js), and whish to get all  
> the values for a given field. Is it safe & efficient to use a match\_all  
> query with term facet ?
> 
> Thanks.
> 
> Yann

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Yann\_Barraud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_barraud/32/1108_2.png) [@Yann\_Barraud](https://discuss.elastic.co/u/Yann_Barraud)\
**Post date:** [February 19, 2013, 9:48am UTC](https://discuss.elastic.co/t/all-values-for-a-given-field/10793/3 "2013-02-19T09:48:52Z")

</div>

Sorry, switching between FR/EN/PT. IHM (fr) = GUI (en).

I normally won't have tons of values. I need juust a list of available  
values of a given field (SQL : select DISTINCT(filed) from TABLE).

I thought doing this using :  
{  
"query" : {  
"match\_all" : { }  
},  
"facets" : {  
"tag" : {  
"terms" : {  
"field" : "STRINGVALUE",  
"all\_terms" : true  
}  
}  
}  
}

Le mardi 19 février 2013 10:32:33 UTC+1, simonw a écrit :

> Hey,
> 
> what is a IHM? 🙂 Depending on the field you might return tons of values  
> and facets will require to pass in a #size. if you oversize this to a large  
> number you might run into problems quickly but if you only need a top N  
> list this should be fine
> 
> simon
> 
> On Tuesday, February 19, 2013 9:28:32 AM UTC+1, Yann Barraud wrote:
> 
> > Hi,
> > 
> > I'm trying to build an IHM (with elastic.js & d3.js), and whish to get  
> > all the values for a given field. Is it safe & efficient to use a match\_all  
> > query with term facet ?
> > 
> > Thanks.
> > 
> > Yann

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [February 19, 2013, 9:54am UTC](https://discuss.elastic.co/t/all-values-for-a-given-field/10793/4 "2013-02-19T09:54:56Z")

</div>

yeah unless your values grow large this should be safe to do.

simon

On Tuesday, February 19, 2013 10:48:52 AM UTC+1, Yann Barraud wrote:

> Sorry, switching between FR/EN/PT. IHM (fr) = GUI (en).
> 
> I normally won't have tons of values. I need juust a list of available  
> values of a given field (SQL : select DISTINCT(filed) from TABLE).
> 
> I thought doing this using :  
> {  
> "query" : {  
> "match\_all" : { }  
> },  
> "facets" : {  
> "tag" : {  
> "terms" : {  
> "field" : "STRINGVALUE",  
> "all\_terms" : true  
> }  
> }  
> }  
> }
> 
> Le mardi 19 février 2013 10:32:33 UTC+1, simonw a écrit :
> 
> > Hey,
> > 
> > what is a IHM? 🙂 Depending on the field you might return tons of values  
> > and facets will require to pass in a #size. if you oversize this to a large  
> > number you might run into problems quickly but if you only need a top N  
> > list this should be fine
> > 
> > simon
> > 
> > On Tuesday, February 19, 2013 9:28:32 AM UTC+1, Yann Barraud wrote:
> > 
> > > Hi,
> > > 
> > > I'm trying to build an IHM (with elastic.js & d3.js), and whish to get  
> > > all the values for a given field. Is it safe & efficient to use a match\_all  
> > > query with term facet ?
> > > 
> > > Thanks.
> > > 
> > > Yann

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Yann\_Barraud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_barraud/32/1108_2.png) [@Yann\_Barraud](https://discuss.elastic.co/u/Yann_Barraud)\
**Post date:** [February 19, 2013, 10:28am UTC](https://discuss.elastic.co/t/all-values-for-a-given-field/10793/5 "2013-02-19T10:28:43Z")

</div>

Thanks Simon !

Le mardi 19 février 2013 10:54:56 UTC+1, simonw a écrit :

> yeah unless your values grow large this should be safe to do.
> 
> simon
> 
> On Tuesday, February 19, 2013 10:48:52 AM UTC+1, Yann Barraud wrote:
> 
> > Sorry, switching between FR/EN/PT. IHM (fr) = GUI (en).
> > 
> > I normally won't have tons of values. I need juust a list of available  
> > values of a given field (SQL : select DISTINCT(filed) from TABLE).
> > 
> > I thought doing this using :  
> > {  
> > "query" : {  
> > "match\_all" : { }  
> > },  
> > "facets" : {  
> > "tag" : {  
> > "terms" : {  
> > "field" : "STRINGVALUE",  
> > "all\_terms" : true  
> > }  
> > }  
> > }  
> > }
> > 
> > Le mardi 19 février 2013 10:32:33 UTC+1, simonw a écrit :
> > 
> > > Hey,
> > > 
> > > what is a IHM? 🙂 Depending on the field you might return tons of values  
> > > and facets will require to pass in a #size. if you oversize this to a large  
> > > number you might run into problems quickly but if you only need a top N  
> > > list this should be fine
> > > 
> > > simon
> > > 
> > > On Tuesday, February 19, 2013 9:28:32 AM UTC+1, Yann Barraud wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I'm trying to build an IHM (with elastic.js & d3.js), and whish to get  
> > > > all the values for a given field. Is it safe & efficient to use a match\_all  
> > > > query with term facet ?
> > > > 
> > > > Thanks.
> > > > 
> > > > Yann

--  
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).  
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:50am UTC](https://discuss.elastic.co/t/all-values-for-a-given-field/10793/6 "2017-07-06T02:50:48Z")

</div>


