You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mark Schoy <he...@gmx.de> on 2011/12/14 16:36:50 UTC

Using LocalParams in StatsComponent to create a price slider?

Hi,

I'm using the StatsComponent to receive to lower and upper bounds of a
price field to create a "price slider".
If someone sets the price range to $100-$200 I have to add a filter to
the query. But then the lower and upper bound are calculated of the
filtered result.

Is it possible to use LocalParams (like for facets) to ignore a specific filter?

Thanks.

Mark

Re: Using LocalParams in StatsComponent to create a price slider?

Posted by Chris Hostetter <ho...@fucit.org>.
: I really don't understand what you're asking, could you clarify with
: an example or two?

I *believe* the question is about wanting to exlcude the effects of some 
"fq" params from the set of documents used to compute stats -- similar to 
how you can exclude tagged filters when generating facet counts...

https://wiki.apache.org/solr/SimpleFacetParameters#Tagging_and_excluding_Filters

So i think Mark is asking if it's possible to do something like this...

http://localhost:8983/solr/select?fq={!tag=cat}cat:electronics&q=*:*&stats=true&stats.field={!ex=cat}price

...but at the moment, stats.field parsing doesn't understand local params 
at all (let alone doing filter exclusion)

If you'd like to open a Jira requesting this feature, I suspect adding 
it wouldn't be too complicated (but i'm not really familiar with the code 
so that's just a guess)

: > I'm using the StatsComponent to receive to lower and upper bounds of a
: > price field to create a "price slider".
: > If someone sets the price range to $100-$200 I have to add a filter to
: > the query. But then the lower and upper bound are calculated of the
: > filtered result.

-Hoss

Re: Using LocalParams in StatsComponent to create a price slider?

Posted by Erick Erickson <er...@gmail.com>.
I really don't understand what you're asking, could you clarify with
an example or two?

Best
Erick

On Wed, Dec 14, 2011 at 10:36 AM, Mark Schoy <he...@gmx.de> wrote:
> Hi,
>
> I'm using the StatsComponent to receive to lower and upper bounds of a
> price field to create a "price slider".
> If someone sets the price range to $100-$200 I have to add a filter to
> the query. But then the lower and upper bound are calculated of the
> filtered result.
>
> Is it possible to use LocalParams (like for facets) to ignore a specific filter?
>
> Thanks.
>
> Mark