John,

This is simply the case of mismatching index-time and query-time analyzers.  
When you use Luke you get the match, but Luke doesn't use the tokenizer+filters 
you specified in Solr for your field.  In your Solr installation, go to Solr 
Admin page, then to Analysis page, enter U2 and select all other relevant 
checkboxes to see how U2 is getting analyzed by Solr.  You should be able to 
spot the incompatibility then.

 Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: John G. Moylan <john.moy...@rte.ie>
> To: solr-user@lucene.apache.org
> Sent: Tuesday, June 23, 2009 6:13:32 AM
> Subject: Search returning 0 results for "U2"
> 
> We are moving from Lucene indexer and readers to a Hybrid solution where
> we still use the Lucene Indexer but use Solr for querying the index.
> 
> I am indexing our content using Lucene 2.3 and have a field called
> "contents" which is tokenized and stored. When I search the contents
> field for "U2" using Luke the correct document turns up. However,
> searching for U2 in solr returns nothing. 
> 
> Any ideas?
> 
> Lucene field is as follows:
> 
> doc.add(new Field("contents", body.replaceAll("  ", ""),
> Field.Store.YES, Field.Index.TOKENIZED));
> 
> Lucene is using the following analyzer:
> 
> result = new ISOLatin1AccentFilter(result);
>         result = new StandardFilter(result);
>         result = new LowerCaseFilter(result);
>         result = new StopFilter(result,StandardAnalyzer.STOP_WORDS);//,
> stopTable);
>         result = new PorterStemFilter(result);
> 
> 
> In Solr I have the field mapped as a text field stored and indexed. The
> text field uses
> 
> 
> positionIncrementGap="100">
>       
>         
>         
>         
>                 ignoreCase="true"
>                 words="stopwords.txt"
>                 enablePositionIncrements="true"
>                 />
>         
> generateWordParts="1" generateNumberParts="1" catenateWords="1"
> catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
>         
>         
> protected="protwords.txt"/>
>         
>       
>       
>         
>         
>         
> synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
>         
> words="stopwords.txt"/>
>         
> generateWordParts="1" generateNumberParts="1" catenateWords="0"
> catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
>         
>         
> protected="protwords.txt"/>
>         
>       
>     
> 
> 
> Regards,
> John

Reply via email to