lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: Complex proximity clauses within Lucene QueryParser
Date Sun, 05 Aug 2007 08:25:56 GMT

As Erick said, the surround query language does the things requested.
It is in contrib/surround.


On Sunday 05 August 2007 06:33, Mark Miller wrote:
> You might check out Qsol:
> It is my attempt at just such a parser. Some of that logic can be open 
> to a bit of interpretation (spans vs nonspans).

I had a quick look at the sources, and I missed a parser definition file
in the svn repository. Did I miss it, and when not, could you add it?

As far as qsol syntax goes, here are some suggestions.
Qsol mostly has binary operators, but with the following
operators also as prefix a lot more would be possible.
(Since there is already a prefix form for field searches, a lookahead in the 
syntax might be needed to avoid ambiguity with such prefix operators.)

& and | as prefix would allow easier mapping to BooleanQuery,
and an extra operator for optional clauses (just like ! now) would
allow all possibilities of BooleanQuery.

operator ~ as prefix would allow multiple arguments to SpanNearQuery,
and with a single argument this could map to SpanFirstQuery.

Actually, with the above additions, qsol seems to be pretty close to
providing all of lucene in a single query language.

Paul Elschot

> - Mark
> tierecke wrote:
> > Hi,
> >
> > I got stuck with a complex proximity clause - and would be grateful to get
> > your help.
> >
> > Does Lucene allow, and if yes: what is the syntax?
> >
> > * Proximity between two phrases, for instance a within n1 words from b 
> > is within n2 words from c?
> > * subclauses - for instance (a or b) within n words from (b* or c)?
> > * "a b" within n words from "c d"?
> >
> > that would help immensely. 
> >
> > best regards from Amsterdam,
> > Nir.
> >   
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message