lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Kor <s0454...@sms.ed.ac.uk>
Subject Re: A special PhraseQuery
Date Sat, 21 May 2005 08:01:18 GMT
Quoting Chris Hostetter <hossman_lucene@fucit.org>:

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

I assume you refer to using BooleanQuery to OR them together? Would it achieve
what I want: an ordered ranking with the best matching phrases at the top and
least matching phrases at the bottom.


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



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