|
|
Kraus, Ralf | pixelhouse ... 2008-10-28, 10:33
Hello,
is there a chance to override the Similarity in my search ? In fact I want that all result return a 1 (with the idf methode).
Greets -Ralf-
-
Re: Override Similarity
Rafał Kuć 2008-10-28, 10:41
Hello!
You can do it, by extending the DefaultSimilarity class from org.apache.lucene.search package. After that, You need to add one line to schema.xml file, which might look like this:
<similarity class="com.company.CustomSimilarity" />
After that, Solr will recognize Your new similarity class and will use it to compute score.
-- Regards, Rafał Kuć
-
Re: Override Similarity
Kraus, Ralf | pixelhouse ... 2008-10-28, 11:02
Rafaďż˝ Kuďż˝ schrieb: > Hello! > > You can do it, by extending the DefaultSimilarity class from > org.apache.lucene.search package. After that, You need to add one line > to schema.xml file, which might look like this: > > <similarity class="com.company.CustomSimilarity" /> > > After that, Solr will recognize Your new similarity class and will use > it to compute score. > > thx ! Runs perfect ....
Greets
-
Re: Override Similarity
Erik Hatcher 2008-10-28, 12:37
On Oct 28, 2008, at 6:33 AM, Kraus, Ralf | pixelhouse GmbH wrote: > is there a chance to override the Similarity in my search ? > In fact I want that all result return a 1 (with the idf methode).
Sure thing, see Solr 1.3.0's example/solr/conf/schema.xml....
<!-- Similarity is the scoring routine for each document vs. a query. A custom similarity may be specified here, but the default is fine for most applications. --> <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/ > --> <!-- ... OR ... Specify a SimilarityFactory class name implementation allowing parameters to be used. --> <!-- <similarity class="com.example.solr.CustomSimilarityFactory"> <str name="paramkey">param value</str> </similarity> -->
-
Re: Override Similarity
Walter Underwood 2008-10-28, 13:56
I'm curious, why do you want to disable idf? --wunder
On 10/28/08 5:37 AM, "Erik Hatcher" <[EMAIL PROTECTED]> wrote:
> > On Oct 28, 2008, at 6:33 AM, Kraus, Ralf | pixelhouse GmbH wrote: >> is there a chance to override the Similarity in my search ? >> In fact I want that all result return a 1 (with the idf methode). > > Sure thing, see Solr 1.3.0's example/solr/conf/schema.xml.... > > <!-- Similarity is the scoring routine for each document vs. a query. > A custom similarity may be specified here, but the default is > fine > for most applications. --> > <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/ >> --> > <!-- ... OR ... > Specify a SimilarityFactory class name implementation > allowing parameters to be used. > --> > <!-- > <similarity class="com.example.solr.CustomSimilarityFactory"> > <str name="paramkey">param value</str> > </similarity> > --> > > >
|
|