# Is it possible to control the last\_seq of a new or existing couchdb river?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-control-the-last-seq-of-a-new-or-existing-couchdb-river/13469>\
**Category:** Elasticsearch\
**Created:** [September 5, 2013, 5:17am UTC](https://discuss.elastic.co/t/is-it-possible-to-control-the-last-seq-of-a-new-or-existing-couchdb-river/13469 "2013-09-05T05:17:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Phunk\_Gadoury](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Brian\_Phunk\_Gadoury](https://discuss.elastic.co/u/Brian_Phunk_Gadoury)\
**Post date:** [September 5, 2013, 5:17am UTC](https://discuss.elastic.co/t/is-it-possible-to-control-the-last-seq-of-a-new-or-existing-couchdb-river/13469/1 "2013-09-05T05:17:48Z")

</div>

I'm trying to figure out if it is possible to create a new river with a  
specified last\_seq value. Alternatively, if it's possible to modify the  
last\_seq value of an existing river _and_ get it to start processing from  
that last\_seq.

Our use case is that we have multiple indices that have the same documents  
but slightly different schemas. Each index has its own river pointed at our  
main BigCouch database. We control which index gets used by our application  
using an index alias.

We always want our river named "live\_river" to point at whatever index our  
alias points at. We accomplish this by just deleting our "live\_river" and  
creating a new "live\_river" whenever we adjust our index alias to put a new  
index into production use.

However, recreating that river means it will re-index all 4.8 million (and  
growing) documents needlessly. This no-op overhead is what I'm trying to  
avoid.

I've tried manually updating an existing river with  
localhost:9200/\_river/live\_river/\_seq -d '{"couchdb":{"last\_seq":"100"}}'  
and it updates that doc, but it has no effect on the behavior of the  
live\_river.

Any ideas?

-Brian

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 5, 2013, 6:15am UTC](https://discuss.elastic.co/t/is-it-possible-to-control-the-last-seq-of-a-new-or-existing-couchdb-river/13469/2 "2013-09-05T06:15:33Z")

</div>

Looking at couchdb river source code, it seems that updating last\_seq will have no effect under a continuous load because it will be erased by [https://github.com/elasticsearch/elasticsearch-river-couchdb/blob/master/src/main/java/org/elasticsearch/river/couchdb/CouchdbRiver.java#L374](https://github.com/elasticsearch/elasticsearch-river-couchdb/blob/master/src/main/java/org/elasticsearch/river/couchdb/CouchdbRiver.java#L374)

I think the only way to handle that is by modifying the source code. On another river project, someone asked me to implement a \_stop / \_start endpoint which pause and resume the river.  
It could help here to update last\_seq.

May be you should open an issue in couchdb river project?

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 sept. 2013 à 07:17, Brian Gadoury [bgadoury@endpoint.com](mailto:bgadoury@endpoint.com) a écrit :

I'm trying to figure out if it is possible to create a new river with a specified last\_seq value. Alternatively, if it's possible to modify the last\_seq value of an existing river _and_ get it to start processing from that last\_seq.

Our use case is that we have multiple indices that have the same documents but slightly different schemas. Each index has its own river pointed at our main BigCouch database. We control which index gets used by our application using an index alias.

We always want our river named "live\_river" to point at whatever index our alias points at. We accomplish this by just deleting our "live\_river" and creating a new "live\_river" whenever we adjust our index alias to put a new index into production use.

However, recreating that river means it will re-index all 4.8 million (and growing) documents needlessly. This no-op overhead is what I'm trying to avoid.

I've tried manually updating an existing river with localhost:9200/\_river/live\_river/\_seq -d '{"couchdb":{"last\_seq":"100"}}' and it updates that doc, but it has no effect on the behavior of the live\_river.

Any ideas?

## -Brian

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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Brian\_Phunk\_Gadoury](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Brian\_Phunk\_Gadoury](https://discuss.elastic.co/u/Brian_Phunk_Gadoury)\
**Post date:** [September 5, 2013, 11:08pm UTC](https://discuss.elastic.co/t/is-it-possible-to-control-the-last-seq-of-a-new-or-existing-couchdb-river/13469/3 "2013-09-05T23:08:06Z")

</div>

Thanks for the reply, David.

I'm quite embarrassed that I didn't think to check the source myself. I'll  
open an issue and hopefully see you there. 🙂

-Brian

On Thursday, September 5, 2013 12:15:33 AM UTC-6, David Pilato wrote:

> Looking at couchdb river source code, it seems that updating last\_seq will  
> have no effect under a continuous load because it will be erased by  
> [https://github.com/elasticsearch/elasticsearch-river-couchdb/blob/master/src/main/java/org/elasticsearch/river/couchdb/CouchdbRiver.java#L374](https://github.com/elasticsearch/elasticsearch-river-couchdb/blob/master/src/main/java/org/elasticsearch/river/couchdb/CouchdbRiver.java#L374)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:17am UTC](https://discuss.elastic.co/t/is-it-possible-to-control-the-last-seq-of-a-new-or-existing-couchdb-river/13469/4 "2017-07-06T02:17:56Z")

</div>


