TermStatsFacet - precalculated?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

TermStatsFacet - precalculated?

Michael Sick
I'm just starting to use the TermStatsFacet package and I was curious to know if all of the stats (min/max/mean/...) are calculated when a TermsStatsFacet response is prepared. If so, isn't this a bit of extra work when a consumer will rarely want all of the stats and most often want one or two? 

Probably not a big concern if we stick with the small set of stats offered but if the number of stats grows, it seems like it would be an issue (vs. dealing with it as we deal with fields and specifying on the request what we want in the response). Guess the same questions apply to the base Stats facets as well.

Today, just curious if my understanding of how this works is correct as it appears to work well for my current use case. Thanks!

--Mike
Reply | Threaded
Open this post in threaded view
|

Re: TermStatsFacet - precalculated?

kimchy
Administrator
The idea with these type of concern is to add flags, that enable/disable computation of expensive aspects of the facet. 

On Tue, Nov 22, 2011 at 3:17 PM, Michael Sick <[hidden email]> wrote:
I'm just starting to use the TermStatsFacet package and I was curious to know if all of the stats (min/max/mean/...) are calculated when a TermsStatsFacet response is prepared. If so, isn't this a bit of extra work when a consumer will rarely want all of the stats and most often want one or two? 

Probably not a big concern if we stick with the small set of stats offered but if the number of stats grows, it seems like it would be an issue (vs. dealing with it as we deal with fields and specifying on the request what we want in the response). Guess the same questions apply to the base Stats facets as well.

Today, just curious if my understanding of how this works is correct as it appears to work well for my current use case. Thanks!

--Mike

Reply | Threaded
Open this post in threaded view
|

Re: TermStatsFacet - precalculated?

Michael Sick
Thanks! That would work just fine (hopefully with an easy button to turn them all off and enable a few). If it's ok to pile on a question, I know we can do custom scripts to calculate a statistic but was curious if there was a good way to define/register a custom stat on the server side. 

On Tue, Nov 22, 2011 at 8:54 AM, Shay Banon <[hidden email]> wrote:
The idea with these type of concern is to add flags, that enable/disable computation of expensive aspects of the facet. 


On Tue, Nov 22, 2011 at 3:17 PM, Michael Sick <[hidden email]> wrote:
I'm just starting to use the TermStatsFacet package and I was curious to know if all of the stats (min/max/mean/...) are calculated when a TermsStatsFacet response is prepared. If so, isn't this a bit of extra work when a consumer will rarely want all of the stats and most often want one or two? 

Probably not a big concern if we stick with the small set of stats offered but if the number of stats grows, it seems like it would be an issue (vs. dealing with it as we deal with fields and specifying on the request what we want in the response). Guess the same questions apply to the base Stats facets as well.

Today, just curious if my understanding of how this works is correct as it appears to work well for my current use case. Thanks!

--Mike


Reply | Threaded
Open this post in threaded view
|

Re: TermStatsFacet - precalculated?

kimchy
Administrator
What do you mean by custom stat? You can plug in your own script to provide a value (and then you get total, min, max for it). That script can do whatever you want. If you want completely custom code, you can plug in your own facet implementation, but its not that simple.

On Tue, Nov 22, 2011 at 4:37 PM, Michael Sick <[hidden email]> wrote:
Thanks! That would work just fine (hopefully with an easy button to turn them all off and enable a few). If it's ok to pile on a question, I know we can do custom scripts to calculate a statistic but was curious if there was a good way to define/register a custom stat on the server side. 


On Tue, Nov 22, 2011 at 8:54 AM, Shay Banon <[hidden email]> wrote:
The idea with these type of concern is to add flags, that enable/disable computation of expensive aspects of the facet. 


On Tue, Nov 22, 2011 at 3:17 PM, Michael Sick <[hidden email]> wrote:
I'm just starting to use the TermStatsFacet package and I was curious to know if all of the stats (min/max/mean/...) are calculated when a TermsStatsFacet response is prepared. If so, isn't this a bit of extra work when a consumer will rarely want all of the stats and most often want one or two? 

Probably not a big concern if we stick with the small set of stats offered but if the number of stats grows, it seems like it would be an issue (vs. dealing with it as we deal with fields and specifying on the request what we want in the response). Guess the same questions apply to the base Stats facets as well.

Today, just curious if my understanding of how this works is correct as it appears to work well for my current use case. Thanks!

--Mike



Reply | Threaded
Open this post in threaded view
|

Re: TermStatsFacet - precalculated?

Michael Sick
My bad for just a quick glimpse at the scripts. I thought they were for custom stats (i.e. my average formula) vs. custom values (total, min, max of custom value).

Either way, I was curious if there would be a way to plugin new stats formulas. Say I wanted a 'range' function, it would be nice to have a way to easily define & register the function but it would have to be a bit more dynamic than adding getRange() to the StatsFacet.


On Tue, Nov 22, 2011 at 10:43 AM, Shay Banon <[hidden email]> wrote:
What do you mean by custom stat? You can plug in your own script to provide a value (and then you get total, min, max for it). That script can do whatever you want. If you want completely custom code, you can plug in your own facet implementation, but its not that simple.


On Tue, Nov 22, 2011 at 4:37 PM, Michael Sick <[hidden email]> wrote:
Thanks! That would work just fine (hopefully with an easy button to turn them all off and enable a few). If it's ok to pile on a question, I know we can do custom scripts to calculate a statistic but was curious if there was a good way to define/register a custom stat on the server side. 


On Tue, Nov 22, 2011 at 8:54 AM, Shay Banon <[hidden email]> wrote:
The idea with these type of concern is to add flags, that enable/disable computation of expensive aspects of the facet. 


On Tue, Nov 22, 2011 at 3:17 PM, Michael Sick <[hidden email]> wrote:
I'm just starting to use the TermStatsFacet package and I was curious to know if all of the stats (min/max/mean/...) are calculated when a TermsStatsFacet response is prepared. If so, isn't this a bit of extra work when a consumer will rarely want all of the stats and most often want one or two? 

Probably not a big concern if we stick with the small set of stats offered but if the number of stats grows, it seems like it would be an issue (vs. dealing with it as we deal with fields and specifying on the request what we want in the response). Guess the same questions apply to the base Stats facets as well.

Today, just curious if my understanding of how this works is correct as it appears to work well for my current use case. Thanks!

--Mike




Reply | Threaded
Open this post in threaded view
|

Re: TermStatsFacet - precalculated?

kimchy
Administrator
Maybe we can talk about specific details of what you are after. Range can easily be done by adding a range filter to the facet (I assume you want the facet to be computed to a specific range).

On Tue, Nov 22, 2011 at 5:52 PM, Michael Sick <[hidden email]> wrote:
My bad for just a quick glimpse at the scripts. I thought they were for custom stats (i.e. my average formula) vs. custom values (total, min, max of custom value).

Either way, I was curious if there would be a way to plugin new stats formulas. Say I wanted a 'range' function, it would be nice to have a way to easily define & register the function but it would have to be a bit more dynamic than adding getRange() to the StatsFacet.


On Tue, Nov 22, 2011 at 10:43 AM, Shay Banon <[hidden email]> wrote:
What do you mean by custom stat? You can plug in your own script to provide a value (and then you get total, min, max for it). That script can do whatever you want. If you want completely custom code, you can plug in your own facet implementation, but its not that simple.


On Tue, Nov 22, 2011 at 4:37 PM, Michael Sick <[hidden email]> wrote:
Thanks! That would work just fine (hopefully with an easy button to turn them all off and enable a few). If it's ok to pile on a question, I know we can do custom scripts to calculate a statistic but was curious if there was a good way to define/register a custom stat on the server side. 


On Tue, Nov 22, 2011 at 8:54 AM, Shay Banon <[hidden email]> wrote:
The idea with these type of concern is to add flags, that enable/disable computation of expensive aspects of the facet. 


On Tue, Nov 22, 2011 at 3:17 PM, Michael Sick <[hidden email]> wrote:
I'm just starting to use the TermStatsFacet package and I was curious to know if all of the stats (min/max/mean/...) are calculated when a TermsStatsFacet response is prepared. If so, isn't this a bit of extra work when a consumer will rarely want all of the stats and most often want one or two? 

Probably not a big concern if we stick with the small set of stats offered but if the number of stats grows, it seems like it would be an issue (vs. dealing with it as we deal with fields and specifying on the request what we want in the response). Guess the same questions apply to the base Stats facets as well.

Today, just curious if my understanding of how this works is correct as it appears to work well for my current use case. Thanks!

--Mike