lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Ferguson" <mark.a.fergu...@gmail.com>
Subject Searching any part of a string
Date Wed, 25 Jun 2008 17:42:35 GMT
Hello,

I am currently keeping an index of all our client's usernames. The search
functionality is implemented using a PrefixFilter. However, we would like to
expand the functionality to be able to search any part of a user's name,
rather than requiring that it begin with the query string. So for example,
the search term 'mit' would return the username 'smith'.

I am hesitant to use a WildcardQuery starting with an asterisk because I've
read about why this is a bad idea. I am looking for suggestions on the best
way to implement this.

The idea I've come up with is to index each part of the username; so for
example, if the username is 'mark', you would index mark, ark, rk, and k.
Then you could still use the PrefixFilter. I'm not overly concerned about
how this would enlarge the index because usernames tend to be fairly short.

I am very much open to other suggestions however. Does anyone have any
opinions or ideas that they can share?

Thanks very much.

Mark

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