Explain flag in CustomQuery

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Explain flag in CustomQuery

Vadim Gindin
Hi All.

I've found that explain flag (that is set via URL) is transferred to
DefaultSearchContext. I'd like to check this flag in my CustomQuery. I
expected that SearchContext will be propagated to a Query, but I didn't
found the way how to get. I only have LeafReaderContext or LeafReader.
Could you advice me?

Regards,
Vadim Gindin
Reply | Threaded
Open this post in threaded view
|

Re: Explain flag in CustomQuery

Mikhail Khludnev-2
Vadim,
Why wouldn't you ask in Elastic forum?

On Mon, Jun 25, 2018 at 11:39 PM Vadim Gindin <[hidden email]> wrote:

> Hi All.
>
> I've found that explain flag (that is set via URL) is transferred to
> DefaultSearchContext. I'd like to check this flag in my CustomQuery. I
> expected that SearchContext will be propagated to a Query, but I didn't
> found the way how to get. I only have LeafReaderContext or LeafReader.
> Could you advice me?
>
> Regards,
> Vadim Gindin
>


--
Sincerely yours
Mikhail Khludnev
Reply | Threaded
Open this post in threaded view
|

Re: Explain flag in CustomQuery

Vadim Gindin
Hi, Mikhail!

That is the real answer :). In other words: Lucene Searcher has 2 separate
APIs: search and explain. They are independent with each other. At the same
time, Elasticsearch provides the other approach where *explain *is not a
"separate action", but is an additional setting to a *search *action. I'll
probably ask that in Elasticsearch forum.  Thanks :)

Regards
Vadim Gindin

On Tue, Jun 26, 2018 at 1:48 AM Mikhail Khludnev <[hidden email]> wrote:

> Vadim,
> Why wouldn't you ask in Elastic forum?
>
> On Mon, Jun 25, 2018 at 11:39 PM Vadim Gindin <[hidden email]>
> wrote:
>
> > Hi All.
> >
> > I've found that explain flag (that is set via URL) is transferred to
> > DefaultSearchContext. I'd like to check this flag in my CustomQuery. I
> > expected that SearchContext will be propagated to a Query, but I didn't
> > found the way how to get. I only have LeafReaderContext or LeafReader.
> > Could you advice me?
> >
> > Regards,
> > Vadim Gindin
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>