lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Technology Preview of new Lucene QueryParser
Date Fri, 12 Jan 2007 02:00:48 GMT

: This sounds troubling to me now :) I may need to clear up my
: understanding of this and rework the parser:
: "A | B | C ! D ! E" wold get parsed as allFields:a allFields:b
: (+allFields:c -allFields:d -allFields:e)
: This is because ! binds tighter than |...
: Sounds like I need to bone up on how I thought this query would operate.
: I set up this logic back when I was new to Lucene and have not
: considered it since. Seems as though the hits will be right but perhaps
: the scoring will not be correct?

it depends on your definition of "correct" .. take a look at the
Query.toString and Explanation.toString output from a query for something
like "A X Y B C -D" vs the same results of "A X Y B (C -D)" or "(A X Y B)
(C -D)" .. particulararly when X and Y aren't in the documents and you'll
see what i mean.

: > seems like a shortcut for "match on foo in ANY of the following
: > fields" would be needed in more cases then a shortfut for "match on foo in
: > ALL of the following fields"
: >
: I was mistaken: it is actually field1:foo field2:foo. OR instead of AND.
: Sorry about that. Obviously it looks like I should be looking into
: DisjunctionMaxQuery instead though.

well, i have an unhealthy obsession with DisjunctionMaxQuery, so don't
assume you *should* use it ... it's just the first thing that occured to
me what i saw your field1,field2(foo) syntax ... making that be a shortcut
for (field1(foo) field2(foo)) is perfectly fine too if that's the use case
you expect to be more useful.

where supporting DisjunctionMaxQuery would really be cool is if you
allowed people to specify the tiebreaker value, with something like...


..and if a tiebreaker isn't specified, you default to just using a

Incidently, is field1(foo bar) a shortcut for field1(foo) field1(bar) like
in the regular QueryParser?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message