# Update index on updating document in Couchdb

**URL:** <https://discuss.elastic.co/t/update-index-on-updating-document-in-couchdb/4525>\
**Category:** Elasticsearch\
**Created:** [June 1, 2011, 9:30pm UTC](https://discuss.elastic.co/t/update-index-on-updating-document-in-couchdb/4525 "2011-06-01T21:30:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kartavya](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@Kartavya](https://discuss.elastic.co/u/Kartavya)\
**Post date:** [June 1, 2011, 9:30pm UTC](https://discuss.elastic.co/t/update-index-on-updating-document-in-couchdb/4525/1 "2011-06-01T21:30:15Z")

</div>

Hi

I have quite different requirement while updating a record in couchdb and  
Elastic Search Index.

Check the scenario below:

Current document in couchdb and index is as follows

fields: A | B | C  
Values: null | v | v

Now I updated the document in couchdb as follows

fields: A | B | C  
Values: v | v | null

Document in index also get updated as  
fields: A | B | C  
Values: v | v | null

\*But \*  
I want document like  
fields: A | B | C  
Values: v | v | v

means \*union \*of existing and updated document.

How it is possible?

Any help would be highly appreciated.

Best Regards,  
Pulkit Agrawal

---

<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:** [June 2, 2011, 7:34am UTC](https://discuss.elastic.co/t/update-index-on-updating-document-in-couchdb/4525/2 "2011-06-02T07:34:47Z")

</div>

Sounds like you will need to manage it on your end then. Make sure when you update a doc in couch, you index the union of it.

On Thursday, June 2, 2011 at 12:30 AM, pulkit aggarwal wrote:

> Hi
> 
> I have quite different requirement while updating a record in couchdb and Elastic Search Index.
> 
> Check the scenario below:
> 
> Current document in couchdb and index is as follows
> 
> fields: A | B | C  
> Values: null | v | v
> 
> Now I updated the document in couchdb as follows
> 
> fields: A | B | C  
> Values: v | v | null
> 
> Document in index also get updated as  
> fields: A | B | C  
> Values: v | v | null
> 
> But  
> I want document like  
> fields: A | B | C  
> Values: v | v | v
> 
> means union of existing and updated document.
> 
> How it is possible?
> 
> Any help would be highly appreciated.
> 
> Best Regards,  
> Pulkit Agrawal

---

<div class="post-metadata">

**Author:** ![Kartavya](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@Kartavya](https://discuss.elastic.co/u/Kartavya)\
**Post date:** [June 2, 2011, 6:27pm UTC](https://discuss.elastic.co/t/update-index-on-updating-document-in-couchdb/4525/3 "2011-06-02T18:27:00Z")

</div>

OK,

So I have to take care in my code itself.

Thanks a lot.

Regards,  
Pulkit Agrawal  
On Thu, Jun 2, 2011 at 1:04 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Sounds like you will need to manage it on your end then. Make sure when  
> you update a doc in couch, you index the union of it.
> 
> On Thursday, June 2, 2011 at 12:30 AM, pulkit aggarwal wrote:
> 
> Hi
> 
> I have quite different requirement while updating a record in couchdb and  
> Elastic Search Index.
> 
> Check the scenario below:
> 
> Current document in couchdb and index is as follows
> 
> fields: A | B | C  
> Values: null | v | v
> 
> Now I updated the document in couchdb as follows
> 
> fields: A | B | C  
> Values: v | v | null
> 
> Document in index also get updated as  
> fields: A | B | C  
> Values: v | v | null
> 
> \*But \*  
> I want document like  
> fields: A | B | C  
> Values: v | v | v
> 
> means \*union \*of existing and updated document.
> 
> How it is possible?
> 
> Any help would be highly appreciated.
> 
> Best Regards,  
> Pulkit Agrawal

---

<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, 4:04am UTC](https://discuss.elastic.co/t/update-index-on-updating-document-in-couchdb/4525/4 "2017-07-06T04:04:49Z")

</div>

Closed on July 6, 2017, 4:04am UTC


