tropo://techno/java /lucene

This is a Lucene Query that performs double metaphone matches, which is an algorithm like soundex that returns words that sound like the word you search on.

Try it on the Lucene/RFC demo search site: http://www.hostmon.com/rfc/advanced.jsp.

Download

DoubleMetaphoneQuery.java DoubleMetaphoneTermEnum.java

You'll need the Jakarta Commons Codec as DoubleMetaphone from it is used.

Implementation Note

Broken into two files (a Query and a TermEnum) as this seems to make debugging easier, and this is how the more elaborate Query's are done.

Does not use boosting as I couldn't decide how how to rank the terms.

You may need to call BooleanQuery.setMaxClauseCount() as depending on your index you could exceed the capacity of a boolean query.