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 Jonathan Vanasco <jv...@2xlp.com> on 2009/09/15 21:54:47 UTC
faceted query not working as i expected
I'm trying to request documents that have "facet.venue_type" as
"Private Collection"
Instead I'm also getting items where another field is marked
"Permanent Collection"
My schema has:
<fields>
<field name="venue_type" type="text" indexed="true" stored="true"
required="false" />
<field name="facet.venue_type" type="string" indexed="true"
stored="true" required="false" />
</fields>
<copyField source="venue_type" dest="facet.venue_type" />
My query is
q=*:*
qt=standard
facet=true
facet.missing=true
facet.field=facet.venue_type
fq=venue_type:Private+Collection
Can anyone offer a suggestion as to what I'm doing wrong ?
Re: faceted query not working as i expected
Posted by Jonathan Vanasco <jv...@2xlp.com>.
Thank you Ahmet.
I forgot to encapuslate the searched string in quotations.
On Sep 15, 2009, at 5:19 PM, AHMET ARSLAN wrote:
>
>
> --- On Tue, 9/15/09, Jonathan Vanasco <jv...@2xlp.com> wrote:
>
>> From: Jonathan Vanasco <jv...@2xlp.com>
>> Subject: faceted query not working as i expected
>> To: solr-user@lucene.apache.org
>> Date: Tuesday, September 15, 2009, 10:54 PM
>> I'm trying to request documents that
>> have "facet.venue_type" as "Private Collection"
>>
>> Instead I'm also getting items where another field is
>> marked "Permanent Collection"
>>
>> My schema has:
>>
>> <fields>
>> <field name="venue_type" type="text"
>> indexed="true" stored="true" required="false" />
>> <field name="facet.venue_type"
>> type="string" indexed="true" stored="true" required="false"
>> />
>> </fields>
>> <copyField source="venue_type" dest="facet.venue_type"
>> />
>>
>>
>> My query is
>>
>> q=*:*
>> qt=standard
>> facet=true
>> facet.missing=true
>> facet.field=facet.venue_type
>> fq=venue_type:Private+Collection
>>
>> Can anyone offer a suggestion as to what I'm doing wrong ?
>>
>
> The filter query fq=venue_type:Private+Collection has a part that
> runs on default field. It is parsed to venue_type:Private
> defaultField:Collection You can use
> fq=venue_type:"Private+Collection"
> or
> fq=venue_type:(Private AND Collection)
> instead.
>
> These will/may bring documents having "something Private Collection"
> in venue_type field since it is a tokenized field.
>
> If you want to retrieve documents that have "facet.venue_type" as
> "Private Collection" you can use fq:facet.venue_type:"Private
> Collection" that operates on a string (non-tokenized) field.
>
> Hope this helps.
>
>
>
Re: faceted query not working as i expected
Posted by AHMET ARSLAN <io...@yahoo.com>.
--- On Tue, 9/15/09, Jonathan Vanasco <jv...@2xlp.com> wrote:
> From: Jonathan Vanasco <jv...@2xlp.com>
> Subject: faceted query not working as i expected
> To: solr-user@lucene.apache.org
> Date: Tuesday, September 15, 2009, 10:54 PM
> I'm trying to request documents that
> have "facet.venue_type" as "Private Collection"
>
> Instead I'm also getting items where another field is
> marked "Permanent Collection"
>
> My schema has:
>
> <fields>
> <field name="venue_type" type="text"
> indexed="true" stored="true" required="false" />
> <field name="facet.venue_type"
> type="string" indexed="true" stored="true" required="false"
> />
> </fields>
> <copyField source="venue_type" dest="facet.venue_type"
> />
>
>
> My query is
>
> q=*:*
> qt=standard
> facet=true
> facet.missing=true
> facet.field=facet.venue_type
> fq=venue_type:Private+Collection
>
> Can anyone offer a suggestion as to what I'm doing wrong ?
>
The filter query fq=venue_type:Private+Collection has a part that runs on default field. It is parsed to venue_type:Private defaultField:Collection You can use
fq=venue_type:"Private+Collection"
or
fq=venue_type:(Private AND Collection)
instead.
These will/may bring documents having "something Private Collection" in venue_type field since it is a tokenized field.
If you want to retrieve documents that have "facet.venue_type" as "Private Collection" you can use fq:facet.venue_type:"Private Collection" that operates on a string (non-tokenized) field.
Hope this helps.