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 Vadim Gindin <vg...@detectum.com> on 2017/11/16 17:09:16 UTC

Custom scoring algorithm and Explanation extending.

Hello

1. I would like to use my custom scoring algorithm. Is it make sense to use
Lucene with other scoring algorithm? What is the best way for that -
implement Similarity and own Queries?


2. I'm reasearching Elasticsearch/Lucene capabilities. Elastichsearch
contains request parameter "explain" that uses Lucene's Explanation class
under the hood. But this class covers only scoring aspects. I would like to
include matching logic details there. It seems a good place but this class
is final..

Regards,
Vadim Gindin

Re: Custom scoring algorithm and Explanation extending.

Posted by Vadim Gindin <vg...@detectum.com>.
Thank's a lot!

On Mon, Nov 20, 2017 at 11:22 PM, Adrien Grand <jp...@gmail.com> wrote:

> Hi Vadim,
>
> Le jeu. 16 nov. 2017 à 18:09, Vadim Gindin <vg...@detectum.com> a écrit
> :
>
> > 1. I would like to use my custom scoring algorithm. Is it make sense to
> use
> > Lucene with other scoring algorithm? What is the best way for that -
> > implement Similarity and own Queries?
> >
>
> It really depends what you are after. Similarity is the right entry point
> if you want to configure how term queries compute their score based on
> index statistics. If this is not flexible enough for you then you will need
> to implement a custom query.
>
>
> > 2. I'm reasearching Elasticsearch/Lucene capabilities. Elastichsearch
> > contains request parameter "explain" that uses Lucene's Explanation class
> > under the hood. But this class covers only scoring aspects. I would like
> to
> > include matching logic details there. It seems a good place but this
> class
> > is final..
> >
>
> Well, you can already do that today, just add sub explanations and put what
> you need in the explanation description. If the float value is irrelevant,
> you can just pass a dummy value.
>

Re: Custom scoring algorithm and Explanation extending.

Posted by Adrien Grand <jp...@gmail.com>.
Hi Vadim,

Le jeu. 16 nov. 2017 à 18:09, Vadim Gindin <vg...@detectum.com> a écrit :

> 1. I would like to use my custom scoring algorithm. Is it make sense to use
> Lucene with other scoring algorithm? What is the best way for that -
> implement Similarity and own Queries?
>

It really depends what you are after. Similarity is the right entry point
if you want to configure how term queries compute their score based on
index statistics. If this is not flexible enough for you then you will need
to implement a custom query.


> 2. I'm reasearching Elasticsearch/Lucene capabilities. Elastichsearch
> contains request parameter "explain" that uses Lucene's Explanation class
> under the hood. But this class covers only scoring aspects. I would like to
> include matching logic details there. It seems a good place but this class
> is final..
>

Well, you can already do that today, just add sub explanations and put what
you need in the explanation description. If the float value is irrelevant,
you can just pass a dummy value.