I think I understand what happened.....

The query "+specific_LIST_s:For Sale" is processed and broken into "For" and 
"Sale".  The specific_LIST_s field is a "string", so it is not tokenized, but 
remains indexed as "For Sale", which matches neither "For" nor "Sale".  Hence, 
no results.

This query solves the problem:
    +specific_LIST_s:"For Sale"

Cheers,
Adam  :-)




----- Original Message ----
From: Dan A. Dickey <dan.dic...@savvis.net>
To: solr-user@lucene.apache.org
Cc: Adam Allgaier <allgai...@yahoo.com>
Sent: Wednesday, September 2, 2009 6:20:13 PM
Subject: Re: Problem querying for a value with a "space"

On Wednesday 02 September 2009 15:15:42 Adam Allgaier wrote:
> Touch gently with the Solr newbie....I've searched trying to find an answer 
> to this problem with no success.  I'm sure it's something small and easy.  
> 
> I'm using Solr 1.3 with Solrj client
> 
> <fieldType name="string" class="solr.StrField" sortMissingLast="true" 
> omitNorms="true"/>
> ...
> <dynamicField name="*_s"  type="string"  indexed="true"  stored="true"/>
> 
> I am indexing the "specific_LIST_s" with the value "For Sale".
> The document indexes just fine.  A query returns the document with the proper 
> value:
>     <str name="specific_LIST_s">For Sale</str>
> 
> However, when I try to query on that field....
>     +specific_LIST_s:For Sale
>     +specific_LIST_s:For+Sale
>     +specific_LIST_s:For%20Sale
> 
> ....I get no results with any one of those three queries.

Your problem looks *very* much like what I just went through.
Not sure, but...

You are searching specific_LIST_s for "For".  The "Sale" part is being searched
for in your defaultSearchField.  Putting "'s around the For Sale won't help 
either.
You need to query something like:
    specific_LIST_s:For OR specific_LIST_s:Sale
At least, that's what I ended up doing.  In my case, I could have changed the
defaultSearchField to what I wanted to search on in this situation - but I 
chose to
explicitly set the query string.  YMMV.
    -Dan

> 
> If I index the value "ForSale" (no space), then execute the query....
>     +specific_LIST_s:ForSale
> 
> ...returns the expected document.
> 
> What am I missing?
> 
> Thanks in advance, 
> Adam  :-)
> 
> 
>      
> 

-- 
Dan A. Dickey | Senior Software Engineer

Savvis
10900 Hampshire Ave. S., Bloomington, MN  55438
Office: 952.852.4803 | Fax: 952.852.4951
E-mail: dan.dic...@savvis.net



      

Reply via email to