lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: A special PhraseQuery
Date Fri, 20 May 2005 19:45:04 GMT
: I'm in need of a special version of the phrase query. For example, given a
: search phrase "alpha beta gamma", I'ld like a to score documents something like
: the following manner.

it sounds like what you want isn't really a special type of query, it's a
special type of query parser.

all of hte individual cases you describe can be handled using Span
queries, and Term queries, you just need to wrap them all up in a
BooleanQuery with the various weights that you want.

: If document contains exactly "alpha beta gamma", score = 1
: If document contains "alpha gamma beta" score = 0.9
: If document contains "gamma alpha beta" score = 0.8
: If document contains "gamma beta alpha" score = 0.7
: If document contains "alpha beta" score = 0.666
: If document contains "beta gamma" score = 0.666
: If document contains "alpha gamma" score = 0.666
: If document contains "alpha" score = 0.333
: If document contains "beta"  score = 0.333
: If document contains "gamma" score = 0.333


-Hoss


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