lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject Re: Complex proximity clauses within Lucene QueryParser
Date Sun, 05 Aug 2007 12:08:09 GMT
Paul Elschot wrote:
> 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.)
>
> Boolean:
> & 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.
>
> Distance:
> 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.
>
> Regards,
> Paul Elschot
>   
http://www.myhardshadow.com/qsolsource/trunk/src/java/com/mhs/qsol/qsol.jtb
It's a jtb file because I am using Java Tree Builder with JavaCC. I left 
out the generated .jj file as it is pretty messy and can be constructed 
with the build script.

I will try and work with your suggestions Paul, thanks for taking a 
look. I had tried some additions like this before without getting too 
far, but certainly worth another shot. I have wanted to get back and 
make some improvements and cleanup anyway. I know the whole parser could 
be a lot better than it is.

Make no mistake, Qsol works great for what I made for (I have some 
personal uses for it), but it could certainly be improved quite a bit. 
It uses a nice infix syntax that I wanted, but overall is not nearly as 
elegant as Surround.

- Mark

---------------------------------------------------------------------
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