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 György Frivolt <gy...@gmail.com> on 2010/02/25 12:03:03 UTC

unexpected result using OR in query

Hi,

    I run into an unexpected behaviour for Solr with query parsing. I need
to fetch article which contain several expressions. However, I noticed the
following behaviour:

- when I fetch results for query A I get a number of results X
- for query B I get a number of results Y
- for query A B and also for A OR B I get results less then X and Y - I
expected that in this case I receive the union of results.

For some queries containing more expressions, but of which all give results
separately I even get zero results. What is the reason for this? How can I
reach to get all the results for the query with more expressions?

My schema for the index and query is pretty simple:

    <fieldtype class='solr.TextField' name='text'
positionIncrementGap='100'>
      <analyzer>
        <charFilter class="solr.MappingCharFilterFactory"
mapping="mapping-ISOLatin1Accent.txt"/>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class='solr.LowerCaseFilterFactory' />
      </analyzer>
    </fieldtype>

Thanks for your help!

     Georg

Re: unexpected result using OR in query

Posted by György Frivolt <fi...@gmail.com>.
Hi Ahmet,

      The default operator is set to AND. In the query I explicitly define
(...) OR (...). In solrconfing more requestHandlers are defined. How do I
find out which one is the default?

Thanks for help,

   Georg

On Thu, Feb 25, 2010 at 3:34 PM, Ahmet Arslan <io...@yahoo.com> wrote:

>
>
> --- On Thu, 2/25/10, György Frivolt <gy...@gmail.com> wrote:
> >     I run into an unexpected behaviour for Solr
> > with query parsing. I need
> > to fetch article which contain several expressions.
> > However, I noticed the
> > following behaviour:
> >
> > - when I fetch results for query A I get a number of
> > results X
> > - for query B I get a number of results Y
> > - for query A B and also for A OR B I get results less then
> > X and Y - I
> > expected that in this case I receive the union of results.
> >
> > For some queries containing more expressions, but of which
> > all give results
> > separately I even get zero results. What is the reason for
> > this? How can I
> > reach to get all the results for the query with more
> > expressions?
>
> What is your default operator defined in schema.xml?
> <solrQueryParser defaultOperator="OR"/>
>
> Are you using standard requestHandler or dismax?
>
>
>
>

Re: unexpected result using OR in query

Posted by Ahmet Arslan <io...@yahoo.com>.

--- On Thu, 2/25/10, György Frivolt <gy...@gmail.com> wrote:
>     I run into an unexpected behaviour for Solr
> with query parsing. I need
> to fetch article which contain several expressions.
> However, I noticed the
> following behaviour:
> 
> - when I fetch results for query A I get a number of
> results X
> - for query B I get a number of results Y
> - for query A B and also for A OR B I get results less then
> X and Y - I
> expected that in this case I receive the union of results.
> 
> For some queries containing more expressions, but of which
> all give results
> separately I even get zero results. What is the reason for
> this? How can I
> reach to get all the results for the query with more
> expressions?

What is your default operator defined in schema.xml? 
<solrQueryParser defaultOperator="OR"/>

Are you using standard requestHandler or dismax?