# NEST: How can I get the raw JSON that comprises a doc just before it's indexed?

**URL:** <https://discuss.elastic.co/t/nest-how-can-i-get-the-raw-json-that-comprises-a-doc-just-before-its-indexed/17409>\
**Category:** Elasticsearch\
**Created:** [May 8, 2014, 1:58pm UTC](https://discuss.elastic.co/t/nest-how-can-i-get-the-raw-json-that-comprises-a-doc-just-before-its-indexed/17409 "2014-05-08T13:58:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rian\_Stockbower](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rian_stockbower/32/1545_2.png) [@Rian\_Stockbower](https://discuss.elastic.co/u/Rian_Stockbower)\
**Post date:** [May 8, 2014, 1:58pm UTC](https://discuss.elastic.co/t/nest-how-can-i-get-the-raw-json-that-comprises-a-doc-just-before-its-indexed/17409/1 "2014-05-08T13:58:44Z")

</div>

Basically, I'm trying to get the raw JSON that would be sent to  
elasticsearch for indexing, _without actually indexing it_. Is there any  
way to do this? I didn't see anything in the docs or unit tests that would  
be useful.

Thanks,  
-Rian

--  
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/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [May 11, 2014, 7:58am UTC](https://discuss.elastic.co/t/nest-how-can-i-get-the-raw-json-that-comprises-a-doc-just-before-its-indexed/17409/2 "2014-05-11T07:58:00Z")

</div>

What version are you using? the latest one (v 1.0.0 beta1, a pre-release on  
nuget) should have this feature

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Thu, May 8, 2014 at 4:58 PM, rianjs [rstockbower@gmail.com](mailto:rstockbower@gmail.com) wrote:

> Basically, I'm trying to get the raw JSON that would be sent to  
> elasticsearch for indexing, _without actually indexing it_. Is there any  
> way to do this? I didn't see anything in the docs or unit tests that would  
> be useful.
> 
> Thanks,  
> -Rian
> 
> --  
> 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/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%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/CAHTr4Zvr51%3DFtz%3DNk49dOA-JxUQs\_5qZASHq45utTJx0EepUQg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zvr51%3DFtz%3DNk49dOA-JxUQs_5qZASHq45utTJx0EepUQg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rian\_Stockbower](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rian_stockbower/32/1545_2.png) [@Rian\_Stockbower](https://discuss.elastic.co/u/Rian_Stockbower)\
**Post date:** [May 11, 2014, 11:09pm UTC](https://discuss.elastic.co/t/nest-how-can-i-get-the-raw-json-that-comprises-a-doc-just-before-its-indexed/17409/3 "2014-05-11T23:09:49Z")

</div>

I'm think I'm using 0.12.0. I'll check out the pre-release version. Will it  
allow me to get the bulk JSON doc as well? (Because that would be super  
sweet!)

Looking at the elasticsearch blog entry about NEST, the relevant change  
looks like this  
one? [show request as json string in debug by azubanov · Pull Request #545 · elastic/elasticsearch-net · GitHub](https://github.com/elasticsearch/elasticsearch-net/pull/545/files)

On Sunday, May 11, 2014 3:58:00 AM UTC-4, Itamar Syn-Hershko wrote:

> What version are you using? the latest one (v 1.0.0 beta1, a pre-release  
> on nuget) should have this feature
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)
> 
> On Thu, May 8, 2014 at 4:58 PM, rianjs \<[rstoc...@gmail.com](mailto:rstoc...@gmail.com) \<javascript:\>\>wrote:
> 
> > Basically, I'm trying to get the raw JSON that would be sent to  
> > elasticsearch for indexing, _without actually indexing it_. Is there any  
> > way to do this? I didn't see anything in the docs or unit tests that would  
> > be useful.
> > 
> > Thanks,  
> > -Rian
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%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/64d8f22b-a339-40c2-a988-efd45793d84e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/64d8f22b-a339-40c2-a988-efd45793d84e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [May 11, 2014, 11:17pm UTC](https://discuss.elastic.co/t/nest-how-can-i-get-the-raw-json-that-comprises-a-doc-just-before-its-indexed/17409/4 "2014-05-11T23:17:58Z")

</div>

This is effective only when you run with the debugger attached, but yes.  
This is effective for all response types.

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Mon, May 12, 2014 at 2:09 AM, rianjs [rstockbower@gmail.com](mailto:rstockbower@gmail.com) wrote:

> I'm think I'm using 0.12.0. I'll check out the pre-release version. Will  
> it allow me to get the bulk JSON doc as well? (Because that would be super  
> sweet!)
> 
> Looking at the elasticsearch blog entry about NEST, the relevant change  
> looks like this one?  
> [show request as json string in debug by azubanov · Pull Request #545 · elastic/elasticsearch-net · GitHub](https://github.com/elasticsearch/elasticsearch-net/pull/545/files)
> 
> On Sunday, May 11, 2014 3:58:00 AM UTC-4, Itamar Syn-Hershko wrote:
> 
> > What version are you using? the latest one (v 1.0.0 beta1, a pre-release  
> > on nuget) should have this feature
> > 
> > --
> > 
> > Itamar Syn-Hershko  
> > [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> > Freelance Developer & Consultant  
> > Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)
> > 
> > On Thu, May 8, 2014 at 4:58 PM, rianjs [rstoc...@gmail.com](mailto:rstoc...@gmail.com) wrote:
> > 
> > > Basically, I'm trying to get the raw JSON that would be sent to  
> > > elasticsearch for indexing, _without actually indexing it_. Is there  
> > > any way to do this? I didn't see anything in the docs or unit tests that  
> > > would be useful.
> > > 
> > > Thanks,  
> > > -Rian
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > 
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%  
> > > [40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%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/64d8f22b-a339-40c2-a988-efd45793d84e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/64d8f22b-a339-40c2-a988-efd45793d84e%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/64d8f22b-a339-40c2-a988-efd45793d84e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/64d8f22b-a339-40c2-a988-efd45793d84e%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/CAHTr4Zstj529STP9zYuPhcka5cehcf%2B2LMgkCLiUiswRY9GNhg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zstj529STP9zYuPhcka5cehcf%2B2LMgkCLiUiswRY9GNhg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Rian\_Stockbower](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rian_stockbower/32/1545_2.png) [@Rian\_Stockbower](https://discuss.elastic.co/u/Rian_Stockbower)\
**Post date:** [May 24, 2014, 1:49pm UTC](https://discuss.elastic.co/t/nest-how-can-i-get-the-raw-json-that-comprises-a-doc-just-before-its-indexed/17409/5 "2014-05-24T13:49:28Z")

</div>

I opened a feature request for this the other day, but it turns out this  
feature exists now, though I think it didn't when I started this thread.  
(Hooray for actively-developed libraries!)

- 

[is there a way to deserialize Elasticsearch Nest search query? - Stack Overflow](http://stackoverflow.com/questions/23703570/is-there-a-way-to-deserialize-elasticsearch-nest-search-query/23704708)

- [Support for getting the raw query JSON without sending it to ES instance · Issue #681 · elastic/elasticsearch-net · GitHub](https://github.com/elasticsearch/elasticsearch-net/issues/681)

-Rian

On Sunday, May 11, 2014 7:17:58 PM UTC-4, Itamar Syn-Hershko wrote:

> This is effective only when you run with the debugger attached, but yes.  
> This is effective for all response types.
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)
> 
> On Mon, May 12, 2014 at 2:09 AM, rianjs \<[rstoc...@gmail.com](mailto:rstoc...@gmail.com) \<javascript:\>\>wrote:
> 
> > I'm think I'm using 0.12.0. I'll check out the pre-release version. Will  
> > it allow me to get the bulk JSON doc as well? (Because that would be super  
> > sweet!)
> > 
> > Looking at the elasticsearch blog entry about NEST, the relevant change  
> > looks like this one?  
> > [show request as json string in debug by azubanov · Pull Request #545 · elastic/elasticsearch-net · GitHub](https://github.com/elasticsearch/elasticsearch-net/pull/545/files)
> > 
> > On Sunday, May 11, 2014 3:58:00 AM UTC-4, Itamar Syn-Hershko wrote:
> > 
> > > What version are you using? the latest one (v 1.0.0 beta1, a pre-release  
> > > on nuget) should have this feature
> > > 
> > > --
> > > 
> > > Itamar Syn-Hershko  
> > > [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> > > Freelance Developer & Consultant  
> > > Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)
> > > 
> > > On Thu, May 8, 2014 at 4:58 PM, rianjs [rstoc...@gmail.com](mailto:rstoc...@gmail.com) wrote:
> > > 
> > > > Basically, I'm trying to get the raw JSON that would be sent to  
> > > > elasticsearch for indexing, _without actually indexing it_. Is there  
> > > > any way to do this? I didn't see anything in the docs or unit tests that  
> > > > would be useful.
> > > > 
> > > > Thanks,  
> > > > -Rian
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > > 
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%  
> > > > [40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6906320e-9cef-4934-88c1-f6904a9f2a56%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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/64d8f22b-a339-40c2-a988-efd45793d84e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/64d8f22b-a339-40c2-a988-efd45793d84e%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/64d8f22b-a339-40c2-a988-efd45793d84e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/64d8f22b-a339-40c2-a988-efd45793d84e%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/e85e41ab-bf5c-4219-9d41-1ad9fcb6eb99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e85e41ab-bf5c-4219-9d41-1ad9fcb6eb99%40googlegroups.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:27am UTC](https://discuss.elastic.co/t/nest-how-can-i-get-the-raw-json-that-comprises-a-doc-just-before-its-indexed/17409/6 "2017-07-06T01:27:13Z")

</div>


