--- On Tue, 9/15/09, Jonathan Vanasco <jvana...@2xlp.com> wrote:

> From: Jonathan Vanasco <jvana...@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.



Reply via email to