# Get certain fields in bulk API response

**URL:** https://discuss.elastic.co/t/get-certain-fields-in-bulk-api-response/23408
**Category:** Elasticsearch
**Created:** [April 27, 2015, 7:55am UTC](https://discuss.elastic.co/t/get-certain-fields-in-bulk-api-response/23408 "2015-04-27T07:55:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jakko\_Sikkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakko_sikkar/32/738_2.png) [@Jakko\_Sikkar](https://discuss.elastic.co/u/Jakko_Sikkar)
#### Post date: [April 27, 2015, 7:55am UTC](https://discuss.elastic.co/t/get-certain-fields-in-bulk-api-response/23408/1 "2015-04-27T07:55:33Z")

</div>

Hi,

I have a ES mapping with ES unique identifier (\_id) and custom identifier.  
I need this custom indentifier to connect documents from ES index to  
database. Ok, so you think why I don't use this custom identifier as \_id  
field. I can't replace ES identifier with this custom identifier because in  
database there can be multiple rows with this identifier. So now if I make  
bulk insert with 1000 objects I get the response with ES identifiers and I  
can't mark objects as indexed in database. Is there any possibility to get  
custom fields from bulk response or is there other solution that I don't  
see at the moment?

--  
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/fd7e1c70-9374-4390-b31f-737a9ae04865%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fd7e1c70-9374-4390-b31f-737a9ae04865%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [April 27, 2015, 8:14am UTC](https://discuss.elastic.co/t/get-certain-fields-in-bulk-api-response/23408/2 "2015-04-27T08:14:02Z")

</div>

You can send a term query after a bulk response, or you can implement your  
own bulk action, which returns the custom ID instead of \_id.

Jörg

On Mon, Apr 27, 2015 at 9:55 AM, Jakko Sikkar [jakko.sikkar@gmail.com](mailto:jakko.sikkar@gmail.com)  
wrote:

> Hi,
> 
> I have a ES mapping with ES unique identifier (\_id) and custom identifier.  
> I need this custom indentifier to connect documents from ES index to  
> database. Ok, so you think why I don't use this custom identifier as \_id  
> field. I can't replace ES identifier with this custom identifier because in  
> database there can be multiple rows with this identifier. So now if I make  
> bulk insert with 1000 objects I get the response with ES identifiers and I  
> can't mark objects as indexed in database. Is there any possibility to get  
> custom fields from bulk response or is there other solution that I don't  
> see at the moment?
> 
> --  
> 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/fd7e1c70-9374-4390-b31f-737a9ae04865%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fd7e1c70-9374-4390-b31f-737a9ae04865%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/fd7e1c70-9374-4390-b31f-737a9ae04865%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/fd7e1c70-9374-4390-b31f-737a9ae04865%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/CAKdsXoHpM7%3DFMXwuHNuKqvBw3aHMEGfCgBEsMmkE%3D8BBMbpgrA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHpM7%3DFMXwuHNuKqvBw3aHMEGfCgBEsMmkE%3D8BBMbpgrA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Jakko\_Sikkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakko_sikkar/32/738_2.png) [@Jakko\_Sikkar](https://discuss.elastic.co/u/Jakko_Sikkar)
#### Post date: [April 27, 2015, 10:11am UTC](https://discuss.elastic.co/t/get-certain-fields-in-bulk-api-response/23408/3 "2015-04-27T10:11:39Z")

</div>

Thank you. Case closed 🙂

esmaspäev, 27. aprill 2015 11:14.12 UTC+3 kirjutas Jörg Prante:

> You can send a term query after a bulk response, or you can implement your  
> own bulk action, which returns the custom ID instead of \_id.
> 
> Jörg
> 
> On Mon, Apr 27, 2015 at 9:55 AM, Jakko Sikkar \<[jakko....@gmail.com](mailto:jakko....@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi,
> > 
> > I have a ES mapping with ES unique identifier (\_id) and custom  
> > identifier. I need this custom indentifier to connect documents from ES  
> > index to database. Ok, so you think why I don't use this custom identifier  
> > as \_id field. I can't replace ES identifier with this custom identifier  
> > because in database there can be multiple rows with this identifier. So now  
> > if I make bulk insert with 1000 objects I get the response with ES  
> > identifiers and I can't mark objects as indexed in database. Is there any  
> > possibility to get custom fields from bulk response or is there other  
> > solution that I don't see at the moment?
> > 
> > --  
> > 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/fd7e1c70-9374-4390-b31f-737a9ae04865%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fd7e1c70-9374-4390-b31f-737a9ae04865%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/fd7e1c70-9374-4390-b31f-737a9ae04865%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/fd7e1c70-9374-4390-b31f-737a9ae04865%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/709d8f7a-0d07-4176-ac01-c161d8eda99c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/709d8f7a-0d07-4176-ac01-c161d8eda99c%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, 12:17am UTC](https://discuss.elastic.co/t/get-certain-fields-in-bulk-api-response/23408/4 "2017-07-06T00:17:40Z")

</div>


