: I'm just starting to get into solr development and I want to try writing a
: custom Scoring Class. I copied the DefaultSimilarity class and renamed it
...
: I then make sure my TestSimilarity is always used by editing
: conf/schema.xml to have this line:
: <similarity class="org.apache.lucene.search.similarities.TestSimilarity" />
:
: Scoring seems to still be using an idf score that is not 1 and returning
: results sorted by rareness of a phrase instead of frequency of the word.
1) what version/branch of Solr are you developing against?
2) where did you put that <similarity /> declaration? do you see
any INFO level log messages from solr on startup that mention
"TestSimilarity" ?
3) what types of test queries are you running?
The method for configuring Similarity instances has changed a lot in the
trunk of Solr now that Lucene uses per-field similarity instances, but
i'm pretty sure having a declaration like that in the "root" of your
schema.xml should still work for providing a "default" similarity for
field types that don't override it.
If you "grep -ri similarity solr/core/src/test solr/core/src/test-files"
you should see some tests (and test configs) demonstrating custom
similarities in use. (although trunk has a lot more tests because there
are a lot more out of the box Similarity classes on trunk)
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]