lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mschipperheyn <>
Subject Finding cityfuzzily but most accurate is most relevant
Date Sat, 21 Jan 2012 15:38:54 GMT

I'm trying to select city names in a way that goes easy on the spelling
mistakes with the most accurate match first. My index for the city name
field is tokenized.
Let's say I'm looking for Rio de Janeiro.

When I search
+city:rio de j
I get 
Rio Tinto 1
Rio Azul 2
Rio de Janeiro 58

This result is so large because of matching on all keywords, including "de",
which undesired. And even with this type of matching I would want Rio de
Janeiro on top as "the most relevant".

+city:"rio de j"
0 results

+city:"rio de j*"
0 results

+city:"rio de janeiro"~1
Rio de Janeiro

+city:"rio de j"~1
0 results

I would want to get this translated to +city:"rio de j*"~1

So, I guess I'm looking for a near phrase query with wild card.

Any suggestions on this?

Kind regards,

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message