lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vesa Marttila <vesa.martt...@mysema.com>
Subject Nested query evaluation regarding negation
Date Thu, 18 Mar 2010 12:24:52 GMT
Hi,

I am adding Apache Lucene support for Querydsl 
http://source.mysema.com/display/querydsl/Querydsl (which offers 
type-safe queries for Java) and I am having problems understanding how 
Lucene evaluates queries especially regarding negation in nested queries.

For instance the following two queries in my opinion are semantically 
the same, but only the first one returns results.

+year:1990 -title:"Jurassic Park"
+year:1990 +(-title:"Jurassic Park")

The simplified object tree in the second example is shown below.

query : Query
   clauses : ArrayList
     [0] : BooleanClause
       "MUST" occur : BooleanClause.Occur
       "year:1990" query : TermQuery
     [1] : BooleanClause
       "MUST" occur : BooleanClause.Occur
       query : BooleanQuery
         clauses : ArrayList
           [0] : BooleanClause
             "MUST_NOT" occur : BooleanClause.Occur
             "title:"Jurassic Park"" query : TermQuery

Lucene's own QueryParser seems to evaluate "AND (NOT" into the same kind 
of object trees.

Is this a bug in Lucene or have I misunderstood Lucene's query 
evaluation? I am happy to give more information if necessary.

Best regards,
Vesa Marttila

-- 
Vesa Marttila <vesa.marttila@mysema.com>
Mysema Ltd, Vilhonkatu 5 A, 00100 Helsinki, Finland
Internet: http://www.mysema.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message