I haven't tried this before (overriding default similarity in a custom
SearchComponent), but it looks like it should be possible. In
QueryComponent.process() you can get a hold of the SolrIndexSearcher and
call setSimilarity(). It also looks like this is set only once by default
when the searcher is created, so you may need to set it back to the default
similarity when you're done.


k/r,
Scott

On Tue, Nov 24, 2015 at 10:25 AM, Markus, Sascha <sas...@uberresearch.com>
wrote:

> Hi,
> I implemented a Similarity which is based on the DefaultSimilarity changing
> the calculation for the idf.
> To work with this CustomSimilarity and the DefaultSimilarity from our
> application I have one field with the default and a copyfield with my
> similarity.
> Concerning the extra space needed for this field I wonder if there is a way
> to have my similarity or the default one on the SAME field. Because there
> are no differences for the index. E.g. by creating a SearchComponent to
> have something like solr/mySelect for queries with my similarity and the
> usual solr/select for the default similarity?
> How could I achive this, has anybody a hint?
>
> Cheers,
>  Sascha
>



-- 
Scott Stults | Founder & Solutions Architect | OpenSource Connections, LLC
| 434.409.2780
http://www.opensourceconnections.com

Reply via email to