lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <>
Subject Re: Limiting QueryParser
Date Wed, 22 Nov 2006 03:34:34 GMT
Chris Hostetter wrote:
> : important:conference agenda
> : I want to end up with
> :
> : +subject:important +subject:conference +subject:agenda
> :
> : I've written something to do this, but I know it is not as clever as QP as
> : currently it can only create BooleanQueries with TermQueries and cannot handle
> : PhraseQuery, so would not handle
> :
> : important:"conference agenda"
> you're on a slippery slope .. basically what you are ssaying is you want
> ":" to be treated as a field seperater *some* ofthe time, and as a
> whitespace hcaracter the rest of the time ... but it's not really clear if
> the rules you want to use are deterministic -- can you describe what you
> want to do to an *arbitrary* input string?

I have a number of UI search fields that are field specific, e.g. Subject, 
Sender, amongst others as well as a "free form" google style field where 
anything can be entered.

On the field specific fields, I want to control the parsing to ensure that the 
parser will not interpret fields in the user entered string, so in those fields 
it treats : as : all of the time.  However, in the "free form" field, anything 
goes and : is a field delimeter all of the time.  So, a user can seach for

Subject  - important:conference agenda
FieldA   - blah:abc
FreeForm - fieldX:Xdata fieldY:Ydata

in the above, the Subject and Field A would have been indexed using configurable 
analysers and would have indexed "important" and "blah", so these are relevant 
to the search.

This should come out as a

(+subject:important +subject:conference +subject:agenda) (+fielda:blah 
+fielda:abc) (+fieldx:xdata +fieldy:ydata)

My framework allows for field specific parsers as well as field specific 
analysers, so having a different query parser for the named fields and the free 
form field is fine.


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

View raw message