You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Patrick Diviacco <pa...@gmail.com> on 2011/03/04 23:33:30 UTC
How to define custom numerical similarity scores in Lucene ?
Queries and Documents in my collection have multiple fields: some numeric
and some textual.
I know how to define custom Similarity classes per field in Lucene: so I
have my textualSimilarity (tf.idf based) and a numericalSimilarity class
(both extending Similarity)
I'm now studying how to implement such numericalSimilarity. I have a math
formula " (queryNumber - docNumber) / normalization factor) to define the
similarity between numeric fields.
But how can I implement this formula in the numericalSimilarity class ?
Which methods should I extend ?
thanks