# Modify explain string in elasticsearch plugin

**URL:** https://discuss.elastic.co/t/modify-explain-string-in-elasticsearch-plugin/17506
**Category:** Elasticsearch
**Created:** [May 14, 2014, 6:36am UTC](https://discuss.elastic.co/t/modify-explain-string-in-elasticsearch-plugin/17506 "2014-05-14T06:36:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Srinivasan\_Ramaswamy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srinivasan_ramaswamy/32/74106_2.png) [@Srinivasan\_Ramaswamy](https://discuss.elastic.co/u/Srinivasan_Ramaswamy)
#### Post date: [May 14, 2014, 6:36am UTC](https://discuss.elastic.co/t/modify-explain-string-in-elasticsearch-plugin/17506/1 "2014-05-14T06:36:08Z")

</div>

Hi

I am overriding the scoring function using a plugin as described in

> **[imotov/elasticsearch-native-script-example](https://github.com/imotov/elasticsearch-native-script-example)**
>
> elasticsearch-native-script-example - Example of Now Deprecated Native Script Plugin for Elasticsearch

I would like to know how to override the explain string, so that i can add  
explanation for all my custom scoring.

Thanks  
Srini

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [May 14, 2014, 11:28pm UTC](https://discuss.elastic.co/t/modify-explain-string-in-elasticsearch-plugin/17506/2 "2014-05-14T23:28:02Z")

</div>

The explain string is basically a JSON formatted string of Lucene's explain  
object. I doubt this formatter is pluggable or that you can change the  
Explain object.

--  
Ivan

On Tue, May 13, 2014 at 11:36 PM, Srinivasan Ramaswamy  
[ursvasan@gmail.com](mailto:ursvasan@gmail.com)wrote:

> Hi
> 
> I am overriding the scoring function using a plugin as described in
> 
> [GitHub - imotov/elasticsearch-native-script-example: Example of Now Deprecated Native Script Plugin for Elasticsearch](https://github.com/imotov/elasticsearch-native-script-example)
> 
> I would like to know how to override the explain string, so that i can add  
> explanation for all my custom scoring.
> 
> Thanks  
> Srini
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV\_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Srinivasan\_Ramaswamy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srinivasan_ramaswamy/32/74106_2.png) [@Srinivasan\_Ramaswamy](https://discuss.elastic.co/u/Srinivasan_Ramaswamy)
#### Post date: [May 15, 2014, 5:14pm UTC](https://discuss.elastic.co/t/modify-explain-string-in-elasticsearch-plugin/17506/3 "2014-05-15T17:14:17Z")

</div>

Does the current explain gives details about the function/script in  
function score query ? If so how is it achieved ? I would like to add  
explanation for my custom scoring so that its easy to investigate. How do  
people achieve this typically using elasticsearch ?

Thanks  
Srini

On Wed, May 14, 2014 at 4:28 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> The explain string is basically a JSON formatted string of Lucene's  
> explain object. I doubt this formatter is pluggable or that you can change  
> the Explain object.
> 
> --  
> Ivan
> 
> On Tue, May 13, 2014 at 11:36 PM, Srinivasan Ramaswamy \<[ursvasan@gmail.com](mailto:ursvasan@gmail.com)
> 
> > wrote:
> 
> > Hi
> > 
> > I am overriding the scoring function using a plugin as described in
> > 
> > [GitHub - imotov/elasticsearch-native-script-example: Example of Now Deprecated Native Script Plugin for Elasticsearch](https://github.com/imotov/elasticsearch-native-script-example)
> > 
> > I would like to know how to override the explain string, so that i can  
> > add explanation for all my custom scoring.
> > 
> > Thanks  
> > Srini
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > 
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/7e2Xe\_mpJYU/unsubscribe](https://groups.google.com/d/topic/elasticsearch/7e2Xe_mpJYU/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV\_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV\_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL1MvVzRZ%2B5eSn85uNFi8BX963Q\_QojcYp72m6unTrmm5SdLUw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL1MvVzRZ%2B5eSn85uNFi8BX963Q_QojcYp72m6unTrmm5SdLUw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [May 16, 2014, 8:47pm UTC](https://discuss.elastic.co/t/modify-explain-string-in-elasticsearch-plugin/17506/4 "2014-05-16T20:47:27Z")

</div>

I looked into the same issue when I first switched over to using custom  
scoring. I did not see a simple solution, so I did not investigate it  
further. Hopefully you will be able to find something.

--  
Ivan

On Thu, May 15, 2014 at 10:14 AM, Srinivasan Ramaswamy  
[ursvasan@gmail.com](mailto:ursvasan@gmail.com)wrote:

> Does the current explain gives details about the function/script in  
> function score query ? If so how is it achieved ? I would like to add  
> explanation for my custom scoring so that its easy to investigate. How do  
> people achieve this typically using elasticsearch ?
> 
> Thanks  
> Srini
> 
> On Wed, May 14, 2014 at 4:28 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > The explain string is basically a JSON formatted string of Lucene's  
> > explain object. I doubt this formatter is pluggable or that you can change  
> > the Explain object.
> > 
> > --  
> > Ivan
> > 
> > On Tue, May 13, 2014 at 11:36 PM, Srinivasan Ramaswamy \<  
> > [ursvasan@gmail.com](mailto:ursvasan@gmail.com)\> wrote:
> > 
> > > Hi
> > > 
> > > I am overriding the scoring function using a plugin as described in
> > > 
> > > [GitHub - imotov/elasticsearch-native-script-example: Example of Now Deprecated Native Script Plugin for Elasticsearch](https://github.com/imotov/elasticsearch-native-script-example)
> > > 
> > > I would like to know how to override the explain string, so that i can  
> > > add explanation for all my custom scoring.
> > > 
> > > Thanks  
> > > Srini
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > > 
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b4485fa8-39f0-40f3-b614-9842c200a0e2%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/7e2Xe\_mpJYU/unsubscribe](https://groups.google.com/d/topic/elasticsearch/7e2Xe_mpJYU/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV\_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV\_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAmU3cKM%3Ddw2NyV_7BZfZn6MnBJ8zy7SX0Ri45epZUPcA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAL1MvVzRZ%2B5eSn85uNFi8BX963Q\_QojcYp72m6unTrmm5SdLUw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL1MvVzRZ%2B5eSn85uNFi8BX963Q_QojcYp72m6unTrmm5SdLUw%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAL1MvVzRZ%2B5eSn85uNFi8BX963Q\_QojcYp72m6unTrmm5SdLUw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAL1MvVzRZ%2B5eSn85uNFi8BX963Q_QojcYp72m6unTrmm5SdLUw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBR2is9JFammnnh%3D4RYa--zOw6bdEsJneX\_ahw673MGXA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBR2is9JFammnnh%3D4RYa--zOw6bdEsJneX_ahw673MGXA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 1:28am UTC](https://discuss.elastic.co/t/modify-explain-string-in-elasticsearch-plugin/17506/5 "2017-07-06T01:28:46Z")

</div>


