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 EwanH <dr...@sneakemail.com> on 2009/09/04 14:51:53 UTC

Facet search field returning results on split words

Hi

I have a solr search where a particular field named "location" is a place
name.  I have the field indexed and stored.  It is quite likely that a field
value could comprise more than one term or at least 2 words split by a space
such as "Burnham Market".  Now if I search on "location:burnham" I get the
appropriate docs returned ok but the facet results return

<lst name="location">
<int name="burnham">2</int>
<int name="thorp">2</int>
</lst>

i.e. values for both words which I don' want.  What can I do about this? 
Can I somehow escape the space when adding the data for indexing?

-- Ewan 
-- 
View this message in context: http://www.nabble.com/Facet-search-field-returning-results-on-split-words-tp25293787p25293787.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Facet search field returning results on split words

Posted by Avlesh Singh <av...@gmail.com>.
Your field needs to be untokenized for expected results. Faceting on the
"text" field that you use to search will give you facets like these. You can
index the same data in some other "string" field and facet on that field.

PS: You can use <copyField> to copy data during index time from one field to
other.

Cheers
Avlesh

On Fri, Sep 4, 2009 at 6:21 PM, EwanH <dr...@sneakemail.com> wrote:

>
> Hi
>
> I have a solr search where a particular field named "location" is a place
> name.  I have the field indexed and stored.  It is quite likely that a
> field
> value could comprise more than one term or at least 2 words split by a
> space
> such as "Burnham Market".  Now if I search on "location:burnham" I get the
> appropriate docs returned ok but the facet results return
>
> <lst name="location">
> <int name="burnham">2</int>
> <int name="thorp">2</int>
> </lst>
>
> i.e. values for both words which I don' want.  What can I do about this?
> Can I somehow escape the space when adding the data for indexing?
>
> -- Ewan
> --
> View this message in context:
> http://www.nabble.com/Facet-search-field-returning-results-on-split-words-tp25293787p25293787.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>