lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Match "best one" from list
Date Fri, 20 Jun 2008 18:50:32 GMT

correct, adding new syntax to the parser currently requires editing the 

Something else you might consider is that ifyou expect "BESTOF" type 
queries to be the default behavior people want, you could just overriget 
the getBooleanQuery method of hte QUeryarser and *always* generate a 
DisMax query for any query containing multiple cuases.

it may not be what you want ... but it's pretty easy.

: > :   BESTOF( "apple"^10, "orange"^9, "pear"^8, "peach"^8, "grapes"^2 )
: Ideally I want to be able to use the queryparser as the requirement above
: will just be 
: an element of a larger query (albeit for now the most complex element). The
: format of 
: the whole query is something which I don't have much control over, hence the
: preference 
: to keep or somehow extend the existing parser.
: The queryparser as is, doesn't seem to support all of the query types, and
: it does 
: seem that the only way to get extended functionality is to modify the
: grammar file 
: QueryParser.jj, and (somehow) build a new parser?  Am I right in thinking
: this, or is there 
: another way to plug new query types into the existing queryparser that I
: havent found?
: I'd rather not mess with the distribution as is, but if theres no other way
: I'll have to roll 
: my sleves up and learn JavaCC :D


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

View raw message