hossman wrote:
> 
> 
> :   BESTOF( "apple"^10, "orange"^9, "pear"^8, "peach"^8, "grapes"^2 )
> : 
> : So ideally in this field we want to find "apple", but would accept one
> of
> : the other pre-defined alternatives as a match. If the document field
> : contains apples it scores higher than if it only contains oranges, but a
> : document with apples AND oranges only has apples taken into
> consideration,
> 
> take a look at DisjunctionMaxQuery.  I'm 90% certain it's exactly what 
> you're talking about.
> 
> -Hoss
> 

Perfect! after a few seemingly unsuccessful tests (all because of my own
stupidity), 
DisjunctionMaxQuery turned out to be exactly what i'm looking for, thank you
very much!

But with great answers come more questions :)

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

Thanks again!

JJ
-- 
View this message in context: 
http://www.nabble.com/Match-%22best-one%22-from-list-tp17805042p17865087.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to