Explain a search against a particular document

Hi,

In order to do some debug I need to use the Lucene feature IndexSearcher#explain(Query q, int doc). I didn't find such API in Elasticsearch. Did I missed it ?

Nicolas

Hello,

2012/2/6 Nicolas Lalevée nicolas.lalevee@hibnet.org:

Hi,

In order to do some debug I need to use the Lucene feature IndexSearcher#explain(Query q, int doc). I didn't find such API in Elasticsearch. Did I missed it ?

Nicolas

I think you are looking for this :

Le 6 févr. 2012 à 19:34, Mohit Chawla a écrit :

Hello,

2012/2/6 Nicolas Lalevée nicolas.lalevee@hibnet.org:

Hi,

In order to do some debug I need to use the Lucene feature IndexSearcher#explain(Query q, int doc). I didn't find such API in Elasticsearch. Did I missed it ?

Nicolas

I think you are looking for this :
Elasticsearch Platform — Find real-time answers at scale | Elastic

Not exactly. The feature you're pointing me is about having explanation about the list of documents, the results of a query. I'm interested in the explanation of the score of a specific document against a query.

Nicolas

No, there ins't an API for that, though we can add one (i.e. give a query and an ID, and explain it).

On Monday, February 6, 2012 at 10:02 PM, Nicolas Lalevée wrote:

Le 6 févr. 2012 à 19:34, Mohit Chawla a écrit :

Hello,

2012/2/6 Nicolas Lalevée <nicolas.lalevee@hibnet.org (mailto:nicolas.lalevee@hibnet.org)>:

Hi,

In order to do some debug I need to use the Lucene feature IndexSearcher#explain(Query q, int doc). I didn't find such API in Elasticsearch. Did I missed it ?

Nicolas

I think you are looking for this :
Elasticsearch Platform — Find real-time answers at scale | Elastic

Not exactly. The feature you're pointing me is about having explanation about the list of documents, the results of a query. I'm interested in the explanation of the score of a specific document against a query.

Nicolas

ok.
If I have some spare cycles, I may propose a patch.

cheers,
Nicolas

Le 7 févr. 2012 à 11:12, Shay Banon a écrit :

No, there ins't an API for that, though we can add one (i.e. give a query and an ID, and explain it).
On Monday, February 6, 2012 at 10:02 PM, Nicolas Lalevée wrote:

Le 6 févr. 2012 à 19:34, Mohit Chawla a écrit :

Hello,

2012/2/6 Nicolas Lalevée nicolas.lalevee@hibnet.org:

Hi,

In order to do some debug I need to use the Lucene feature IndexSearcher#explain(Query q, int doc). I didn't find such API in Elasticsearch. Did I missed it ?

Nicolas

I think you are looking for this :
Elasticsearch Platform — Find real-time answers at scale | Elastic

Not exactly. The feature you're pointing me is about having explanation about the list of documents, the results of a query. I'm interested in the explanation of the score of a specific document against a query.

Nicolas

I implemented it, you can review it on my github [1]

I am not sure if I have put the code at the right place, if i should have put the code of TransportExplainAction#shardOperation in a SearchService or in a IndexService. Let me know what you think.

Nicolas

[1] https://github.com/nlalevee/elasticsearch/tree/explain

Le 7 févr. 2012 à 14:22, Nicolas Lalevée a écrit :

ok.
If I have some spare cycles, I may propose a patch.

cheers,
Nicolas

Le 7 févr. 2012 à 11:12, Shay Banon a écrit :

No, there ins't an API for that, though we can add one (i.e. give a query and an ID, and explain it).
On Monday, February 6, 2012 at 10:02 PM, Nicolas Lalevée wrote:

Le 6 févr. 2012 à 19:34, Mohit Chawla a écrit :

Hello,

2012/2/6 Nicolas Lalevée nicolas.lalevee@hibnet.org:

Hi,

In order to do some debug I need to use the Lucene feature IndexSearcher#explain(Query q, int doc). I didn't find such API in Elasticsearch. Did I missed it ?

Nicolas

I think you are looking for this :
Elasticsearch Platform — Find real-time answers at scale | Elastic

Not exactly. The feature you're pointing me is about having explanation about the list of documents, the results of a query. I'm interested in the explanation of the score of a specific document against a query.

Nicolas

Looks good!. I think it requires some cleaning up (for example,
ExplainDocResult is not used, and I don't think we need id on the explain
source builder), but those are cosmetics :). Create a pull request?

2012/3/28 Nicolas Lalevée nicolas.lalevee@hibnet.org

I implemented it, you can review it on my github [1]

I am not sure if I have put the code at the right place, if i should have
put the code of TransportExplainAction#shardOperation in a SearchService or
in a IndexService. Let me know what you think.

Nicolas

[1] https://github.com/nlalevee/elasticsearch/tree/explain

Le 7 févr. 2012 à 14:22, Nicolas Lalevée a écrit :

ok.
If I have some spare cycles, I may propose a patch.

cheers,
Nicolas

Le 7 févr. 2012 à 11:12, Shay Banon a écrit :

No, there ins't an API for that, though we can add one (i.e. give a
query and an ID, and explain it).
On Monday, February 6, 2012 at 10:02 PM, Nicolas Lalevée wrote:

Le 6 févr. 2012 à 19:34, Mohit Chawla a écrit :

Hello,

2012/2/6 Nicolas Lalevée nicolas.lalevee@hibnet.org:

Hi,

In order to do some debug I need to use the Lucene feature
IndexSearcher#explain(Query q, int doc). I didn't find such API in
Elasticsearch. Did I missed it ?

Nicolas

I think you are looking for this :
Elasticsearch Platform — Find real-time answers at scale | Elastic

Not exactly. The feature you're pointing me is about having
explanation about the list of documents, the results of a query. I'm
interested in the explanation of the score of a specific document against a
query.

Nicolas

Le 28 mars 2012 à 13:51, Shay Banon a écrit :

Looks good!. I think it requires some cleaning up (for example, ExplainDocResult is not used, and I don't think we need id on the explain source builder), but those are cosmetics :). Create a pull request?

done.

ExplainDocResult was indeed useless. I did also some cleanup of the javadoc.
Note that the implementation I have done is mainly a copy/paste/merge of the /get and /search services, I don't understand every line in this patch, feel free to rework.

Next would be patching the doc. Maybe I'll have spare cycle tomorrow to do so.

cheers,
Nicolas

2012/3/28 Nicolas Lalevée nicolas.lalevee@hibnet.org
I implemented it, you can review it on my github [1]

I am not sure if I have put the code at the right place, if i should have put the code of TransportExplainAction#shardOperation in a SearchService or in a IndexService. Let me know what you think.

Nicolas

[1] https://github.com/nlalevee/elasticsearch/tree/explain

Le 7 févr. 2012 à 14:22, Nicolas Lalevée a écrit :

ok.
If I have some spare cycles, I may propose a patch.

cheers,
Nicolas

Le 7 févr. 2012 à 11:12, Shay Banon a écrit :

No, there ins't an API for that, though we can add one (i.e. give a query and an ID, and explain it).
On Monday, February 6, 2012 at 10:02 PM, Nicolas Lalevée wrote:

Le 6 févr. 2012 à 19:34, Mohit Chawla a écrit :

Hello,

2012/2/6 Nicolas Lalevée nicolas.lalevee@hibnet.org:

Hi,

In order to do some debug I need to use the Lucene feature IndexSearcher#explain(Query q, int doc). I didn't find such API in Elasticsearch. Did I missed it ?

Nicolas

I think you are looking for this :
Elasticsearch Platform — Find real-time answers at scale | Elastic

Not exactly. The feature you're pointing me is about having explanation about the list of documents, the results of a query. I'm interested in the explanation of the score of a specific document against a query.

Nicolas