# Populating IndexRequestBuilder from a Lucene Document instance?

**URL:** <https://discuss.elastic.co/t/populating-indexrequestbuilder-from-a-lucene-document-instance/6299>\
**Category:** Elasticsearch\
**Created:** [January 6, 2012, 10:24am UTC](https://discuss.elastic.co/t/populating-indexrequestbuilder-from-a-lucene-document-instance/6299 "2012-01-06T10:24:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kai\_lilleby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kai_lilleby/32/3019_2.png) [@kai\_lilleby](https://discuss.elastic.co/u/kai_lilleby)\
**Post date:** [January 6, 2012, 10:24am UTC](https://discuss.elastic.co/t/populating-indexrequestbuilder-from-a-lucene-document-instance/6299/1 "2012-01-06T10:24:15Z")

</div>

Are there any simple ways of populating av ES IndexRequestBuilder from  
a populated Lucene Document instance, i.e. reading out all fields  
added to the Document instance and adding them to the  
IndexRequestBuilder (or a ES Request instance)

The concrete use case is:  
I have a JMS queue containing Lucene Document instance - and want to  
consume that queue and add the received Documents to ES - imlemented  
using a Es River, much like the way the elasticsearch-river-rabbitmq  
plugin does it, except that queue contains Lucene Document instances,  
not json-formated index requests.

The queue is fed by the Hibernate Search slave backend.

Any ideas?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 6, 2012, 11:40am UTC](https://discuss.elastic.co/t/populating-indexrequestbuilder-from-a-lucene-document-instance/6299/2 "2012-01-06T11:40:38Z")

</div>

Just go over the fields and build a json request with them. Should be  
simple now? No need to have a river for that.

On Fri, Jan 6, 2012 at 12:24 PM, Kai Lilleby [kai@systemfabrikken.no](mailto:kai@systemfabrikken.no) wrote:

> Are there any simple ways of populating av ES IndexRequestBuilder from  
> a populated Lucene Document instance, i.e. reading out all fields  
> added to the Document instance and adding them to the  
> IndexRequestBuilder (or a ES Request instance)
> 
> The concrete use case is:  
> I have a JMS queue containing Lucene Document instance - and want to  
> consume that queue and add the received Documents to ES - imlemented  
> using a Es River, much like the way the elasticsearch-river-rabbitmq  
> plugin does it, except that queue contains Lucene Document instances,  
> not json-formated index requests.
> 
> The queue is fed by the Hibernate Search slave backend.
> 
> Any ideas?

---

<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, 3:43am UTC](https://discuss.elastic.co/t/populating-indexrequestbuilder-from-a-lucene-document-instance/6299/3 "2017-07-06T03:43:40Z")

</div>


