First thing to do is attach &query=debug to your queries and look at the
parsed output.

Second thing to do is look at the admin/analysis page and see what happens
at index and query time to things like o'reilly. You have
WordDelimiterFilterFactory
configured in your query but not index analysis chain. My bet on that is
that
you're getting different tokens at query and index time...

Third thing is that you need to escape the & character. It's probably being
interpreted as a delimiter on the URL and Solr ignores params it doesn't
understand.

Best
Erick


On Mon, Aug 26, 2013 at 5:08 PM, Utkarsh Sengar <utkarsh2...@gmail.com>wrote:

> Some of the queries (not all) with special chars return no documents.
>
> Example: queries returning no documents
> q=m&m (this can be explained, when I search for "m m", no documents are
> returned)
> q=o'reilly (when I search for "o reilly", I get documents back)
>
>
> Queries returning documents:
> q=hello&world (document matched is "Hello World: A Life in Ham Radio")
>
>
> My questions are:
> 1. What's wrong with "o'reilly"? What changes do I need in my field type?
> 2. How can I make the query "m&m" work?
> My indexe has a bunch of M&M's docs like: "M & M's Milk Chocolate Candy
> Coated Peanuts  19.2 oz" and ""M and Ms Chocolate Candies - Peanut - 1 Bag
> (42 oz)"
>
>
> FIeld type:
>         <fieldType name="text_general" class="solr.TextField"
> positionIncrementGap="100">
>              <analyzer type="index">
>                   <tokenizer class="solr.StandardTokenizerFactory"/>
>                   <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" enablePositionIncrements="true" />
>                   <filter class="solr.LowerCaseFilterFactory"/>
>                   <filter class="solr.EnglishMinimalStemFilterFactory"/>
>                   <filter class="solr.ASCIIFoldingFilterFactory"/>
>                   <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>             </analyzer>
>             <analyzer type="query">
>                   <filter class="solr.WordDelimiterFilterFactory"
> generateWordParts="1" generateNumberParts="1"
>
> catenateWords="1"
>
> catenateNumbers="1"
>
> catenateAll="0"
>
> preserveOriginal="1"/>
>                   <tokenizer class="solr.StandardTokenizerFactory"/>
>                   <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" enablePositionIncrements="true" />
>                   <filter class="solr.LowerCaseFilterFactory"/>
>                   <filter class="solr.EnglishMinimalStemFilterFactory"/>
>                   <filter class="solr.ASCIIFoldingFilterFactory"/>
>                   <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>             </analyzer>
>         </fieldType>
>
>
> --
> Thanks,
> -Utkarsh
>

Reply via email to