lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romiko Derbynew <Romiko.Derby...@readify.onmicrosoft.com>
Subject Fuzzy Search Sorting
Date Tue, 22 Nov 2011 22:21:36 GMT
Hi Guys,

I am using Lucene with neo4j database.

Currently if I do a fuzzy search via a rest call using the Query API with this data

GivenName: John
FamilyName: Smith

GivenName: Bob
FamilyName: Smith


GivenName: Adam
FamilyName: Smith

GivenName: Bill
FamilyName: Smath

If I query the index like this +(FamilyName:smith~)

The query results shows Smath on the top
e.g.
Smath, Bill
Smith, Adam
Smith, Bob
Smith, John

I thought lucene would automatically sort the fuzzy search result with most relevant on the
top, why in this case is Smath on the top, it should be on the bottom, no?

Also, if I have two index keys (FamilyName, GivenName), and I search like this:
+(FamilyName:smith~^8 GivenName:smith~^2)

And I have this data set
GivenName: John
FamilyName: Smith

GivenName: Bob
FamilyName: Smith

GivenName: Adam
FamilyName: Smith

GivenName: Bill
FamilyName: Smath

GivenName: Smith
FamilyName: Harry

GivenName: Smath
FamilyName: Sally

I would want the result to first sort by Highest match and then by booster priority
Adam Smith
Bob Smith
John Smith
Smith Harry
Bill Smath
Smath Sally

How, can I achieve this with the Query Parser (http://lucene.apache.org/java/3_1_0/queryparsersyntax.html)

Much Appreciated.
Romiko

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