# Painless Debug.explain is NOT a println

**URL:** https://discuss.elastic.co/t/painless-debug-explain-is-not-a-println/117146
**Category:** Elasticsearch
**Created:** [January 26, 2018, 4:46am UTC](https://discuss.elastic.co/t/painless-debug-explain-is-not-a-println/117146 "2018-01-26T04:46:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![luis1](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@luis1](https://discuss.elastic.co/u/luis1)
#### Post date: [January 26, 2018, 4:46am UTC](https://discuss.elastic.co/t/painless-debug-explain-is-not-a-println/117146/1 "2018-01-26T04:46:46Z")

</div>

Painless Debug.explain is NOT a println because interrupts the flow. Is there any way I can print a variable without interrupting the scoring for the document? Thanks.

---

<div class="post-metadata">

### Author: ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)
#### Post date: [January 26, 2018, 5:05pm UTC](https://discuss.elastic.co/t/painless-debug-explain-is-not-a-println/117146/2 "2018-01-26T17:05:19Z")

</div>

No, doing disk writes per document within a scoring script would be _very_ expensive. Debug.explain is a compromise that helps with debugging, but without affecting performance of a real script (eg you cannot accidentally leave it in and have performance issues because the script doesn't actually score when Debug.explain is present).

---

<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: [February 23, 2018, 5:05pm UTC](https://discuss.elastic.co/t/painless-debug-explain-is-not-a-println/117146/3 "2018-02-23T17:05:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
