Faceting and filter on aggregated values

Hi All,

Is there a way that the filter can be applied on the aggregated values.

My requirement is to apply filter on aggregated values;
example;

list all cities with mobile_sales greater than 5,000.
I can do this by TermsStatsFacetBuilder, where my key field is city and
value field is mobile_sales.

But I cannot apply the filter on the aggregated values of mobile_sales. The
filter will be applied at the record/row level of mobile_sales.

It there a way or workaround for this. Or is this something that I need to
tweak in elastic search?

Thanks
Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I was able to figure out this one.

The facet class give you the handle to apply the logic at the aggregation
level on terms.

@Override

*public* Facet reduce(List<Facet> facets) 

Here all the data from respective shards is merged to get the final output.
The logic can be applied here,to apply the filter on aggregated values.

But this solution would require changing the elastic search code. And I do
not want to modify the existing elastic search code.

Any other option or way of achieving this?

Thanks

Amit

On Monday, July 8, 2013 2:49:30 PM UTC+5:30, Amit Singh wrote:

Hi All,

Is there a way that the filter can be applied on the aggregated values.

My requirement is to apply filter on aggregated values;
example;

list all cities with mobile_sales greater than 5,000.
I can do this by TermsStatsFacetBuilder, where my key field is city and
value field is mobile_sales.

But I cannot apply the filter on the aggregated values of mobile_sales.
The filter will be applied at the record/row level of mobile_sales.

It there a way or workaround for this. Or is this something that I need to
tweak in elastic search?

Thanks
Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Amit,

This is something you currently need to do in your application layer or
indeed write a custom facet.

Pretty sure you know, but if you are only interested in a great-than
filtering, you can sort the term stat's response by total (in you example,
the sum of mobile_sales) and ignore all the entries (cities) bellow your
threshold.

Cheers,
Boaz

On Monday, July 8, 2013 8:24:22 PM UTC+2, Amit Singh wrote:

I was able to figure out this one.

The facet class give you the handle to apply the logic at the aggregation
level on terms.

@Override

*public* Facet reduce(List<Facet> facets) 

Here all the data from respective shards is merged to get the final
output. The logic can be applied here,to apply the filter on aggregated
values.

But this solution would require changing the elastic search code. And I do
not want to modify the existing elastic search code.

Any other option or way of achieving this?

Thanks

Amit

On Monday, July 8, 2013 2:49:30 PM UTC+5:30, Amit Singh wrote:

Hi All,

Is there a way that the filter can be applied on the aggregated values.

My requirement is to apply filter on aggregated values;
example;

list all cities with mobile_sales greater than 5,000.
I can do this by TermsStatsFacetBuilder, where my key field is city and
value field is mobile_sales.

But I cannot apply the filter on the aggregated values of mobile_sales.
The filter will be applied at the record/row level of mobile_sales.

It there a way or workaround for this. Or is this something that I need
to tweak in elastic search?

Thanks
Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

@Amit -

This is what you are looking for -


You can write your custom aggregation logic using this.

~Ban

On Tue, Jul 9, 2013 at 5:52 PM, Boaz Leskes b.leskes@gmail.com wrote:

Hi Amit,

This is something you currently need to do in your application layer or
indeed write a custom facet.

Pretty sure you know, but if you are only interested in a great-than
filtering, you can sort the term stat's response by total (in you example,
the sum of mobile_sales) and ignore all the entries (cities) bellow your
threshold.

Cheers,
Boaz

On Monday, July 8, 2013 8:24:22 PM UTC+2, Amit Singh wrote:

I was able to figure out this one.

The facet class give you the handle to apply the logic at the aggregation
level on terms.

@Override

*public* Facet reduce(List<Facet> facets)

Here all the data from respective shards is merged to get the final
output. The logic can be applied here,to apply the filter on aggregated
values.

But this solution would require changing the elastic search code. And I
do not want to modify the existing elastic search code.

Any other option or way of achieving this?

Thanks

Amit

On Monday, July 8, 2013 2:49:30 PM UTC+5:30, Amit Singh wrote:

Hi All,

Is there a way that the filter can be applied on the aggregated values.

My requirement is to apply filter on aggregated values;
example;

list all cities with mobile_sales greater than 5,000.
I can do this by TermsStatsFacetBuilder, where my key field is city and
value field is mobile_sales.

But I cannot apply the filter on the aggregated values of mobile_sales.
The filter will be applied at the record/row level of mobile_sales.

It there a way or workaround for this. Or is this something that I need
to tweak in elastic search?

Thanks
Amit

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Amit, do you able to solve this? I am into the same problem. I need to filter facet result based on the aggregrated value.

@Amit,
do you able to solve this? I am into the same problem. I need to filter
facet result based on the aggregated value.

On Thursday, July 11, 2013 3:31:10 PM UTC-4, Ban Mido wrote:

@Amit -

This is what you are looking for -
https://github.com/imotov/elasticsearch-facet-script
You can write your custom aggregation logic using this.

~Ban

On Tue, Jul 9, 2013 at 5:52 PM, Boaz Leskes <b.le...@gmail.com<javascript:>

wrote:

Hi Amit,

This is something you currently need to do in your application layer or
indeed write a custom facet.

Pretty sure you know, but if you are only interested in a great-than
filtering, you can sort the term stat's response by total (in you example,
the sum of mobile_sales) and ignore all the entries (cities) bellow your
threshold.

Cheers,
Boaz

On Monday, July 8, 2013 8:24:22 PM UTC+2, Amit Singh wrote:

I was able to figure out this one.

The facet class give you the handle to apply the logic at the
aggregation level on terms.

@Override

*public* Facet reduce(List<Facet> facets) 

Here all the data from respective shards is merged to get the final
output. The logic can be applied here,to apply the filter on aggregated
values.

But this solution would require changing the elastic search code. And I
do not want to modify the existing elastic search code.

Any other option or way of achieving this?

Thanks

Amit

On Monday, July 8, 2013 2:49:30 PM UTC+5:30, Amit Singh wrote:

Hi All,

Is there a way that the filter can be applied on the aggregated values.

My requirement is to apply filter on aggregated values;
example;

list all cities with mobile_sales greater than 5,000.
I can do this by TermsStatsFacetBuilder, where my key field is city
and value field is mobile_sales.

But I cannot apply the filter on the aggregated values of mobile_sales.
The filter will be applied at the record/row level of mobile_sales.

It there a way or workaround for this. Or is this something that I need
to tweak in elastic search?

Thanks
Amit

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Kajal,

I was able to build a plugin based faceting , and apply custom logic in
facet.

Go through the different links provided by the group members. You should be
able to achieve it.

Thanks
Amit

On Tue, Jul 16, 2013 at 8:20 PM, Kajal Patel kajal23@gmail.com wrote:

@Amit,
do you able to solve this? I am into the same problem. I need to filter
facet result based on the aggregated value.

On Thursday, July 11, 2013 3:31:10 PM UTC-4, Ban Mido wrote:

@Amit -

This is what you are looking for - https://github.com/imotov/**
elasticsearch-facet-scripthttps://github.com/imotov/elasticsearch-facet-script
You can write your custom aggregation logic using this.

~Ban

On Tue, Jul 9, 2013 at 5:52 PM, Boaz Leskes b.le...@gmail.com wrote:

Hi Amit,

This is something you currently need to do in your application layer or
indeed write a custom facet.

Pretty sure you know, but if you are only interested in a great-than
filtering, you can sort the term stat's response by total (in you example,
the sum of mobile_sales) and ignore all the entries (cities) bellow your
threshold.

Cheers,
Boaz

On Monday, July 8, 2013 8:24:22 PM UTC+2, Amit Singh wrote:

I was able to figure out this one.

The facet class give you the handle to apply the logic at the
aggregation level on terms.

@Override

*public* Facet reduce(List<Facet> facets)

Here all the data from respective shards is merged to get the final
output. The logic can be applied here,to apply the filter on
aggregated values.

But this solution would require changing the elastic search code. And I
do not want to modify the existing elastic search code.

Any other option or way of achieving this?

Thanks

Amit

On Monday, July 8, 2013 2:49:30 PM UTC+5:30, Amit Singh wrote:

Hi All,

Is there a way that the filter can be applied on the aggregated values.

My requirement is to apply filter on aggregated values;
example;

list all cities with mobile_sales greater than 5,000.
I can do this by TermsStatsFacetBuilder, where my key field is city
and value field is mobile_sales.

But I cannot apply the filter on the aggregated values of
mobile_sales. The filter will be applied at the record/row level of
mobile_sales.

It there a way or workaround for this. Or is this something that I
need to tweak in elastic search?

Thanks
Amit

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Amit, thanks for your reply.

Is your plugin available for public?? Also, did you try facet scripting for
the same problem?

On Tuesday, July 16, 2013 11:20:29 AM UTC-4, Amit Singh wrote:

Hi Kajal,

I was able to build a plugin based faceting , and apply custom logic in
facet.

Go through the different links provided by the group members. You should
be able to achieve it.

Thanks
Amit

On Tue, Jul 16, 2013 at 8:20 PM, Kajal Patel <kaj...@gmail.com<javascript:>

wrote:

@Amit,
do you able to solve this? I am into the same problem. I need to filter
facet result based on the aggregated value.

On Thursday, July 11, 2013 3:31:10 PM UTC-4, Ban Mido wrote:

@Amit -

This is what you are looking for - https://github.com/imotov/**
elasticsearch-facet-scripthttps://github.com/imotov/elasticsearch-facet-script
You can write your custom aggregation logic using this.

~Ban

On Tue, Jul 9, 2013 at 5:52 PM, Boaz Leskes b.le...@gmail.com wrote:

Hi Amit,

This is something you currently need to do in your application layer or
indeed write a custom facet.

Pretty sure you know, but if you are only interested in a great-than
filtering, you can sort the term stat's response by total (in you example,
the sum of mobile_sales) and ignore all the entries (cities) bellow your
threshold.

Cheers,
Boaz

On Monday, July 8, 2013 8:24:22 PM UTC+2, Amit Singh wrote:

I was able to figure out this one.

The facet class give you the handle to apply the logic at the
aggregation level on terms.

@Override

*public* Facet reduce(List<Facet> facets) 

Here all the data from respective shards is merged to get the final
output. The logic can be applied here,to apply the filter on
aggregated values.

But this solution would require changing the elastic search code. And
I do not want to modify the existing elastic search code.

Any other option or way of achieving this?

Thanks

Amit

On Monday, July 8, 2013 2:49:30 PM UTC+5:30, Amit Singh wrote:

Hi All,

Is there a way that the filter can be applied on the aggregated
values.

My requirement is to apply filter on aggregated values;
example;

list all cities with mobile_sales greater than 5,000.
I can do this by TermsStatsFacetBuilder, where my key field is city
and value field is mobile_sales.

But I cannot apply the filter on the aggregated values of
mobile_sales. The filter will be applied at the record/row level of
mobile_sales.

It there a way or workaround for this. Or is this something that I
need to tweak in elastic search?

Thanks
Amit

--
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 elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.