I'm using SOLR 1.4.1 with SOLR-1553 applied (edismax query parser).  I'm 
experiencing inconsistent behavior with terms grouped in parenthesis.  
Sometimes they are AND'ed and sometimes OR'ed together.

1. q=Title:(life)&defType=edismax  > 285 results
2. q=Title:(hope)&defType=edismax  > 34 results

3. q=Title:(life AND hope)&defType=edismax > 1 result
4. q=Title:(life OR hope)&defType=edismax > 318 results
5. q=Title:(life hope)&defType=edismax  > 1 result (life, hope are being AND'ed 
together)

6. q=Title:(life AND hope) AND Title:(life)&defType=edismax > 1 result
7. q=Title:(life OR hope) AND Title:(life)&defType=edismax > 285 result
8. q=Title:(life hope) AND Title:(life)&defType=edismax > 285 results (life, 
hope are being OR'ed together)

See how in #5, the two terms get AND'ed, but by adding the additional 
(nonsense) clause in #8, the first two terms get OR'ed .  Is this a feature or 
a bug?  Am I likely doing something wrong?

I've tried this both with ...defaultOperator="AND"... and 
...defaultOperator="OR"...  I've also tried the two settings with "q.op".  It 
seems as if edismax doesn't use these at all.

When using the default query parser, I get consistent AND/OR logic as expected. 
 That is, if the "defaultOperator" (or q.op if specified) is always 
consistently applied.

As a workaround, I think I can just always insert the operator (as in examples 
6 & 7).  However, this is an extra burden on our clients that I'd like to avoid 
if at all possible.

See below for more configuration information.  Any ideas are appreciated.

James Dyer
E-Commerce Systems
Ingram Content Group
(615) 213-4311


Snippets from schema.xml:

<fieldType name="textStemmed" class="solr.TextField" positionIncrementGap="100">
               <analyzer type="index">
                              <tokenizer 
class="solr.WhitespaceTokenizerFactory"/>
                              <filter class="solr.StopFilterFactory" 
ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
                              <filter class="solr.WordDelimiterFilterFactory" 
generateWordParts="1" generateNumberParts="0" catenateWords="0" 
catenateNumbers="0" catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0" 
stemEnglishPossessive="1" />
                              <filter class="solr.LowerCaseFilterFactory"/>
                              <filter class="solr.PorterStemFilterFactory"/>
               </analyzer>
               <analyzer type="query">
                              <tokenizer 
class="solr.WhitespaceTokenizerFactory"/>
                              <filter class="solr.SynonymFilterFactory" 
synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
                              <filter class="solr.StopFilterFactory" 
ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
                              <filter class="solr.WordDelimiterFilterFactory" 
generateWordParts="1" generateNumberParts="0" catenateWords="0" 
catenateNumbers="0" catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0" 
stemEnglishPossessive="1" />
                              <filter class="solr.LowerCaseFilterFactory"/>
                              <filter class="solr.PorterStemFilterFactory"/>
               </analyzer>
</fieldType>

...

<field name="Title" type="textStemmed" indexed="true" stored="true" 
multiValued="false" omitNorms="true" omitTermFreqAndPositions="false" />

...

<solrQueryParser defaultOperator="AND"/>

Reply via email to