TermStatsFacet - precalculated?


(Michael Sick) #1

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


(Shay Banon) #2

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 <
michael.sick@serenesoftware.com> 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


(Michael Sick) #3

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 kimchy@gmail.com 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 <
michael.sick@serenesoftware.com> 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


(Shay Banon) #4

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 <
michael.sick@serenesoftware.com> 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 kimchy@gmail.com 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 <
michael.sick@serenesoftware.com> 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


(Michael Sick) #5

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 kimchy@gmail.com 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 <
michael.sick@serenesoftware.com> 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 kimchy@gmail.com 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 <
michael.sick@serenesoftware.com> 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


(Shay Banon) #6

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 <
michael.sick@serenesoftware.com> 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 kimchy@gmail.com 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 <
michael.sick@serenesoftware.com> 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 kimchy@gmail.com 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 <
michael.sick@serenesoftware.com> 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


(system) #7