# Significant\_term for other metrics?

**URL:** <https://discuss.elastic.co/t/significant-term-for-other-metrics/22162>\
**Category:** Elasticsearch\
**Created:** [February 13, 2015, 9:24pm UTC](https://discuss.elastic.co/t/significant-term-for-other-metrics/22162 "2015-02-13T21:24:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darshat\_Shah](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Darshat\_Shah](https://discuss.elastic.co/u/Darshat_Shah)\
**Post date:** [February 13, 2015, 9:24pm UTC](https://discuss.elastic.co/t/significant-term-for-other-metrics/22162/1 "2015-02-13T21:24:10Z")

</div>

Hi,  
The significant\_term aggregation compares occurance of a term in foreground  
population vs. background population. Is there a way to do this for numeric  
fields?

The scenario is there is a set of documents matching a filter. The average  
value of a field in those documents will be quite different from the  
average value of the field over all documents.

Document Type =  
{  
int _filter_  
int metric  
string _foo_  
}

We want to find the _foo_ values in documents where the average value of  
metric in the documents matching _filter_ is differentiated from the  
average value over the whole set.

Thanks  
Darshat

--  
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/94aa1be5-e56d-41ef-a335-8555151c3589%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/94aa1be5-e56d-41ef-a335-8555151c3589%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood\_2](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@Mark\_Harwood\_2](https://discuss.elastic.co/u/Mark_Harwood_2)\
**Post date:** [February 13, 2015, 10:18pm UTC](https://discuss.elastic.co/t/significant-term-for-other-metrics/22162/2 "2015-02-13T22:18:25Z")

</div>

See the "global" aggregation for how you might derive an unfiltered metric  
for use as your "background" stats.

On Friday, February 13, 2015 at 9:24:10 PM UTC, Darshat Shah wrote:

> Hi,  
> The significant\_term aggregation compares occurance of a term in  
> foreground population vs. background population. Is there a way to do this  
> for numeric fields?
> 
> The scenario is there is a set of documents matching a filter. The average  
> value of a field in those documents will be quite different from the  
> average value of the field over all documents.
> 
> Document Type =  
> {  
> int _filter_  
> int metric  
> string _foo_  
> }
> 
> We want to find the _foo_ values in documents where the average value of  
> metric in the documents matching _filter_ is differentiated from the  
> average value over the whole set.
> 
> Thanks  
> Darshat

--  
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/484e42dd-a2f4-40b7-b2df-ad41b87c5e68%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/484e42dd-a2f4-40b7-b2df-ad41b87c5e68%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Darshat\_Shah](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Darshat\_Shah](https://discuss.elastic.co/u/Darshat_Shah)\
**Post date:** [February 14, 2015, 6:44am UTC](https://discuss.elastic.co/t/significant-term-for-other-metrics/22162/3 "2015-02-14T06:44:50Z")

</div>

Thanks Mark. Using that, how can we extract the _foo_ values where the  
metric differs significantly?

On Saturday, February 14, 2015 at 3:48:25 AM UTC+5:30, Mark Harwood wrote:

> See the "global" aggregation for how you might derive an unfiltered metric  
> for use as your "background" stats.
> 
> On Friday, February 13, 2015 at 9:24:10 PM UTC, Darshat Shah wrote:
> 
> > Hi,  
> > The significant\_term aggregation compares occurance of a term in  
> > foreground population vs. background population. Is there a way to do this  
> > for numeric fields?
> > 
> > The scenario is there is a set of documents matching a filter. The  
> > average value of a field in those documents will be quite different from  
> > the average value of the field over all documents.
> > 
> > Document Type =  
> > {  
> > int _filter_  
> > int metric  
> > string _foo_  
> > }
> > 
> > We want to find the _foo_ values in documents where the average value of  
> > metric in the documents matching _filter_ is differentiated from the  
> > average value over the whole set.
> > 
> > Thanks  
> > Darshat

--  
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/7b78533a-1eee-4bb5-8e85-0296893006bf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7b78533a-1eee-4bb5-8e85-0296893006bf%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood\_2](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@Mark\_Harwood\_2](https://discuss.elastic.co/u/Mark_Harwood_2)\
**Post date:** [February 14, 2015, 10:06am UTC](https://discuss.elastic.co/t/significant-term-for-other-metrics/22162/4 "2015-02-14T10:06:33Z")

</div>

Right now you'd have to do that in your client - pairing up the background numbers from the global agg and related numbers in your existing agg to derive growth.  
There's a scripted metric too which let's you write map reduce type code but I'm not sure that would work

--  
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/1e22ee26-e814-43a8-8665-92aa7a0ccd05%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1e22ee26-e814-43a8-8665-92aa7a0ccd05%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:32am UTC](https://discuss.elastic.co/t/significant-term-for-other-metrics/22162/5 "2017-07-06T00:32:47Z")

</div>


