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 Tommy Chheng <to...@gmail.com> on 2009/10/12 02:37:48 UTC
Facet query help
The dummy data set is composed of 6 docs.
My query is set for 'tommy' with the facet query of Memory_s:1+GB
http://lh:8983/solr/select/?facet=true&facet.field=CPU_s&facet.field=Memory_s&facet.field=Video+Card_s&wt=ruby&facet.query=Memory_s:1+GB&q=tommy&indent=on
However, in the response (http://pastie.org/650932), I get two docs: one
which has the correct field Memory_s:1 GB and the second document which
has a Memory_s:3+GB. Why did the second document match if i set the
facet.query to just 1+GB??
I'm using Solr 1.4 trunk
thanks
tommy
Re: Facet query help
Posted by Chris Hostetter <ho...@fucit.org>.
: the original pastie(http://pastie.org/650932). I tried the fq query body with
: quotes and without quotes.
the entire fq param shouldn't be in quotes ... just the value that you
want to query on (since it's a string field and you want the whole field
treated as a single string...
fq = Memory_s:"1 GB"
fq=Memory_s:%221+GB%22
-Hoss
Re: Facet query help
Posted by Tommy Chheng <to...@gmail.com>.
ok, so fq != facet.query. i thought it was an alias. I'm trying your
suggestion fq=Memory_s:"1 GB" and now it's returning zero documents even
though there is one document that has "tommy" and "Memory_s:1 GB" as
seen in the original pastie(http://pastie.org/650932). I tried the fq
query body with quotes and without quotes.
http://lh:8983/solr/select/?facet=true&facet.field=CPU_s&facet.field=Memory_s&facet.field=Video+Card_s&wt=ruby&fq=%22Memory_s:1+GB%22&q=tommy&indent=on
Any thoughts?
thanks,
tommy
On 10/12/09 1:00 AM, Shalin Shekhar Mangar wrote:
> On Mon, Oct 12, 2009 at 6:07 AM, Tommy Chheng<to...@gmail.com>wrote:
>
>
>> The dummy data set is composed of 6 docs.
>>
>> My query is set for 'tommy' with the facet query of Memory_s:1+GB
>>
>> http://lh:8983/solr/select/?facet=true&facet.field=CPU_s&facet.field=Memory_s&facet.field=Video+Card_s&wt=ruby&facet.query=Memory_s:1+GB&q=tommy&indent=on
>>
>> However, in the response (http://pastie.org/650932), I get two docs: one
>> which has the correct field Memory_s:1 GB and the second document which has
>> a Memory_s:3+GB. Why did the second document match if i set the facet.query
>> to just 1+GB??
>>
>>
>>
> facet.query does not limit documents. It is used for finding the number of
> documents matching the query. In order to filter the result set you should
> use filter query e.g. fq=Memory_s:"1 GB"
>
>
Re: Facet query help
Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Mon, Oct 12, 2009 at 6:07 AM, Tommy Chheng <to...@gmail.com>wrote:
> The dummy data set is composed of 6 docs.
>
> My query is set for 'tommy' with the facet query of Memory_s:1+GB
>
> http://lh:8983/solr/select/?facet=true&facet.field=CPU_s&facet.field=Memory_s&facet.field=Video+Card_s&wt=ruby&facet.query=Memory_s:1+GB&q=tommy&indent=on
>
> However, in the response (http://pastie.org/650932), I get two docs: one
> which has the correct field Memory_s:1 GB and the second document which has
> a Memory_s:3+GB. Why did the second document match if i set the facet.query
> to just 1+GB??
>
>
facet.query does not limit documents. It is used for finding the number of
documents matching the query. In order to filter the result set you should
use filter query e.g. fq=Memory_s:"1 GB"
--
Regards,
Shalin Shekhar Mangar.