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 Yuhao <nf...@yahoo.com> on 2012/02/10 00:58:25 UTC

Range facet - Count in facet menu != Count in search results

I've changed the "facet.range.include" option to every possible value (lower, upper, edge, outer, all)**.  It only changes the count shown in the "Ranges" facet menu on the left.  It has no effect on the count and results shown in search results, which ALWAYS is inclusive of both the lower AND upper bounds (which is equivalent to "include = all").  Is this by design?  I would like to make the search results include the lower bound, but not the upper bound.  Can I do that?

My range field is multi-valued, but I don't think that should be the problem.

** Actually, it doesn't like "outer" for some reason, which leaves the facet completely empty.

Re: Range facet - Count in facet menu != Count in search results

Posted by Erick Erickson <er...@gmail.com>.
I'll answer for Jan "Yes". Prior to 4.0, you cannot mix
inclusive and exclusive operators on a range query. see:
https://issues.apache.org/jira/browse/SOLR-355. If you
can't go to 4.0, you can cheat and make, say, your top
value a tiny bit less than the boundary. For an int-based
field [1 To 20] use [1 TO 19]. For a float field [1 TO 19.999999]
or some such.

Faceting is not really related to what's in the results
list in terms of counts, etc., it's just a way of counting
buckets. Changing the faceting parameters will not change
the displayed results, which is what it appears you're
expecting....

Best
Erick

On Fri, Feb 10, 2012 at 10:45 AM, Yuhao <nf...@yahoo.com> wrote:
> Jay,
>
> Was the curly closing bracket "}" intentional?  I'm using 3.4, which also supports "fq=price:[10 TO 20]".  The problem is the results are not working properly.
>
>
>
>
> ________________________________
>  From: Jan Høydahl <ja...@cominvent.com>
> To: solr-user@lucene.apache.org; Yuhao <nf...@yahoo.com>
> Sent: Thursday, February 9, 2012 7:45 PM
> Subject: Re: Range facet - Count in facet menu != Count in search results
>
> Hi,
>
> If you use trunk (4.0) version, you can say fq=price:[10 TO 20} and have the upper bound be exclusive.
>
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
> Solr Training - www.solrtraining.com
>
> On 10. feb. 2012, at 00:58, Yuhao wrote:
>
>> I've changed the "facet.range.include" option to every possible value (lower, upper, edge, outer, all)**.  It only changes the count shown in the "Ranges" facet menu on the left.  It has no effect on the count and results shown in search results, which ALWAYS is inclusive of both the lower AND upper bounds (which is equivalent to "include = all").  Is this by design?  I would like to make the search results include the lower bound, but not the upper bound.  Can I do that?
>>
>> My range field is multi-valued, but I don't think that should be the problem.
>>
>> ** Actually, it doesn't like "outer" for some reason, which leaves the facet completely empty.

Re: Range facet - Count in facet menu != Count in search results

Posted by Darren Govoni <da...@ontrenet.com>.
Double check your default operator for a faceted search vs. regular
search. I caught this difference in my work that explained this
difference.

On Fri, 2012-02-10 at 07:45 -0800, Yuhao wrote:
> Jay,
> 
> Was the curly closing bracket "}" intentional?  I'm using 3.4, which also supports "fq=price:[10 TO 20]".  The problem is the results are not working properly.
> 
> 
> 
> 
> ________________________________
>  From: Jan Høydahl <ja...@cominvent.com>
> To: solr-user@lucene.apache.org; Yuhao <nf...@yahoo.com> 
> Sent: Thursday, February 9, 2012 7:45 PM
> Subject: Re: Range facet - Count in facet menu != Count in search results
>  
> Hi,
> 
> If you use trunk (4.0) version, you can say fq=price:[10 TO 20} and have the upper bound be exclusive.
> 
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
> Solr Training - www.solrtraining.com
> 
> On 10. feb. 2012, at 00:58, Yuhao wrote:
> 
> > I've changed the "facet.range.include" option to every possible value (lower, upper, edge, outer, all)**.  It only changes the count shown in the "Ranges" facet menu on the left.  It has no effect on the count and results shown in search results, which ALWAYS is inclusive of both the lower AND upper bounds (which is equivalent to "include = all").  Is this by design?  I would like to make the search results include the lower bound, but not the upper bound.  Can I do that?
> > 
> > My range field is multi-valued, but I don't think that should be the problem.
> > 
> > ** Actually, it doesn't like "outer" for some reason, which leaves the facet completely empty.



Re: Range facet - Count in facet menu != Count in search results

Posted by Yuhao <nf...@yahoo.com>.
Jay,

Was the curly closing bracket "}" intentional?  I'm using 3.4, which also supports "fq=price:[10 TO 20]".  The problem is the results are not working properly.




________________________________
 From: Jan Høydahl <ja...@cominvent.com>
To: solr-user@lucene.apache.org; Yuhao <nf...@yahoo.com> 
Sent: Thursday, February 9, 2012 7:45 PM
Subject: Re: Range facet - Count in facet menu != Count in search results
 
Hi,

If you use trunk (4.0) version, you can say fq=price:[10 TO 20} and have the upper bound be exclusive.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

On 10. feb. 2012, at 00:58, Yuhao wrote:

> I've changed the "facet.range.include" option to every possible value (lower, upper, edge, outer, all)**.  It only changes the count shown in the "Ranges" facet menu on the left.  It has no effect on the count and results shown in search results, which ALWAYS is inclusive of both the lower AND upper bounds (which is equivalent to "include = all").  Is this by design?  I would like to make the search results include the lower bound, but not the upper bound.  Can I do that?
> 
> My range field is multi-valued, but I don't think that should be the problem.
> 
> ** Actually, it doesn't like "outer" for some reason, which leaves the facet completely empty.

Re: Range facet - Count in facet menu != Count in search results

Posted by Jan Høydahl <ja...@cominvent.com>.
Hi,

If you use trunk (4.0) version, you can say fq=price:[10 TO 20} and have the upper bound be exclusive.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

On 10. feb. 2012, at 00:58, Yuhao wrote:

> I've changed the "facet.range.include" option to every possible value (lower, upper, edge, outer, all)**.  It only changes the count shown in the "Ranges" facet menu on the left.  It has no effect on the count and results shown in search results, which ALWAYS is inclusive of both the lower AND upper bounds (which is equivalent to "include = all").  Is this by design?  I would like to make the search results include the lower bound, but not the upper bound.  Can I do that?
> 
> My range field is multi-valued, but I don't think that should be the problem.
> 
> ** Actually, it doesn't like "outer" for some reason, which leaves the facet completely empty.