lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Barbarelli <>
Subject Re: Is there way to get complete start end matches to be first in the list ?
Date Tue, 08 Sep 2009 20:51:40 GMT
What I do is run each entry in the hits collection through a home-rolled
levenstein distance algorithm to obtain a score. Then I sort by score.

On Sep 8, 2009 9:44 PM, "Paul Taylor" <> wrote:

Is there way to get complete start end matches to be first in the list

We use Lucene to search song albums titles typically one to ten words long.
If the user enter something like 'foo bar' everything that contains foo bar
is returned with max score , thats fine but it would be better if an exact
match is right at the top. Also although an OR Search has been entered would
be great if that it ranked matches where both words are together higher than
when they are not , but still return results that only match one condirtion.

Ideally giving results in this order

  * Foo Bar (exact match)
  * The Foo Bar Somethings (substring - exact match)
  * Bar Foo (all terms match)
  * Bar Baz and the Foo (substring - all terms match)
  * Foo (some terms match)
  * Foo Something (substring - some terms match)

Is there something I can do in Lucene, or some way I can modify the query
(as entered by the user) to get results better aproaching this


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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message