On Dec 28, 2007 4:05 PM, Grant Ingersoll <[EMAIL PROTECTED]> wrote:
> I have a custom Similarity class that I would like to load.  It has a
> no-arg constructor, so it should work fine within Solr's context.
> However, it has the option for other constructor input values as well
> that I would like to be able to set.  Is there a way to set these
> values in Solr via the schema.xml declaration?  In looking at
> IndexSchema.java, it seems like it is not supported, but I was
> wondering if I was missing something.
One option for a custom similarity is to have it implement the
NamedListInitializedPlugin interface.
Solr would have to be modified to check for that interface for similarity.

But it's probably more practical to just create a subclass of your
Similarity that hard-codes the values, and then refer to that in the
schema.xml (since there is only going to be one Similarity in the
system).

-Yonik

Reply via email to