# Custom mapping on river only picks up new documents in db

**URL:** <https://discuss.elastic.co/t/custom-mapping-on-river-only-picks-up-new-documents-in-db/10966>\
**Category:** Elasticsearch\
**Created:** [March 1, 2013, 1:14pm UTC](https://discuss.elastic.co/t/custom-mapping-on-river-only-picks-up-new-documents-in-db/10966 "2013-03-01T13:14:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teddy777](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Teddy777](https://discuss.elastic.co/u/Teddy777)\
**Post date:** [March 1, 2013, 1:14pm UTC](https://discuss.elastic.co/t/custom-mapping-on-river-only-picks-up-new-documents-in-db/10966/1 "2013-03-01T13:14:35Z")

</div>

The steps I take to create custom mapping on a couchdb database:

Create a new couchdb called test\_db  
Add a document with \_id - user\_id

Create index called 'custom \_index'  
Create custom mapping - very basic for the time being for testing purpose  
( {'properties': {'last\_name': {'type': 'string'}}})  
Put this mapping on custom index.

Now create my river using custom\_index

Add another document with \_id - user\_id\_2 to my couchdb.

Now when I look at the status of my index, its taken my custom mapping  
correctly -all good, however when I query it it only shows the doc that was  
added after the river was created. Am I right in assuming that the river on  
setup should find all the existing docs? Clearly on river creation with  
dynamic mapping the index picks up all the existing docs. What I am doing  
differently?

--  
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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [March 2, 2013, 1:33am UTC](https://discuss.elastic.co/t/custom-mapping-on-river-only-picks-up-new-documents-in-db/10966/2 "2013-03-02T01:33:46Z")

</div>

I don't think the issue is related to your mapping. I have never used  
the CouchDB river, but it seems like the river will only pick up new  
changes. It is probably scanning the change log (or whatever the CouchDB  
equivalent is called).

--  
Ivan

On Fri, Mar 1, 2013 at 5:14 AM, Teddy777 [richard@findinvestgrow.com](mailto:richard@findinvestgrow.com) wrote:

> The steps I take to create custom mapping on a couchdb database:
> 
> Create a new couchdb called test\_db  
> Add a document with \_id - user\_id
> 
> Create index called 'custom \_index'  
> Create custom mapping - very basic for the time being for testing purpose  
> ( {'properties': {'last\_name': {'type': 'string'}}})  
> Put this mapping on custom index.
> 
> Now create my river using custom\_index
> 
> Add another document with \_id - user\_id\_2 to my couchdb.
> 
> Now when I look at the status of my index, its taken my custom mapping  
> correctly -all good, however when I query it it only shows the doc that was  
> added after the river was created. Am I right in assuming that the river on  
> setup should find all the existing docs? Clearly on river creation with  
> dynamic mapping the index picks up all the existing docs. What I am doing  
> differently?
> 
> --  
> 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:** ![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:** [March 2, 2013, 7:03am UTC](https://discuss.elastic.co/t/custom-mapping-on-river-only-picks-up-new-documents-in-db/10966/3 "2013-03-02T07:03:06Z")

</div>

CouchDb river get all \_changes from a given point (sequence).  
When you start the river the first time, no sequence is defined so it should get all existing document.

Can you gist a curl recreation with all commands you did (create db, add doc, create river, add doc, search)?

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

Le 2 mars 2013 à 02:33, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) a écrit :

> I don't think the issue is related to your mapping. I have never used the CouchDB river, but it seems like the river will only pick up new changes. It is probably scanning the change log (or whatever the CouchDB equivalent is called).
> 
> --  
> Ivan
> 
> On Fri, Mar 1, 2013 at 5:14 AM, Teddy777 [richard@findinvestgrow.com](mailto:richard@findinvestgrow.com) wrote:
> 
> > The steps I take to create custom mapping on a couchdb database:
> > 
> > Create a new couchdb called test\_db  
> > Add a document with \_id - user\_id
> > 
> > Create index called 'custom \_index'  
> > Create custom mapping - very basic for the time being for testing purpose ( {'properties': {'last\_name': {'type': 'string'}}})  
> > Put this mapping on custom index.
> > 
> > Now create my river using custom\_index
> > 
> > Add another document with \_id - user\_id\_2 to my couchdb.
> > 
> > ## Now when I look at the status of my index, its taken my custom mapping correctly -all good, however when I query it it only shows the doc that was added after the river was created. Am I right in assuming that the river on setup should find all the existing docs? Clearly on river creation with dynamic mapping the index picks up all the existing docs. What I am doing differently?
> > 
> > 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).

--  
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:** ![Teddy777](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@Teddy777](https://discuss.elastic.co/u/Teddy777)\
**Post date:** [March 4, 2013, 3:39pm UTC](https://discuss.elastic.co/t/custom-mapping-on-river-only-picks-up-new-documents-in-db/10966/4 "2013-03-04T15:39:14Z")

</div>

Hi guys, thanks for your replies, I think I have resolved this problem now.

I was only creating my mapping afresh each time I tried to get this  
working. My river was never recreated so it got all the changes from the db  
on my first go at creating a manual mapping but on subsequent goes there  
were no changes in the db so obviously no results in my new index. To  
resolve this I just start with a new river and new index for each mapping I  
try to create.

On Friday, 1 March 2013 13:14:35 UTC, Teddy777 wrote:

> The steps I take to create custom mapping on a couchdb database:
> 
> Create a new couchdb called test\_db  
> Add a document with \_id - user\_id
> 
> Create index called 'custom \_index'  
> Create custom mapping - very basic for the time being for testing purpose  
> ( {'properties': {'last\_name': {'type': 'string'}}})  
> Put this mapping on custom index.
> 
> Now create my river using custom\_index
> 
> Add another document with \_id - user\_id\_2 to my couchdb.
> 
> Now when I look at the status of my index, its taken my custom mapping  
> correctly -all good, however when I query it it only shows the doc that was  
> added after the river was created. Am I right in assuming that the river on  
> setup should find all the existing docs? Clearly on river creation with  
> dynamic mapping the index picks up all the existing docs. What I am doing  
> differently?

--  
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:48am UTC](https://discuss.elastic.co/t/custom-mapping-on-river-only-picks-up-new-documents-in-db/10966/5 "2017-07-06T02:48:33Z")

</div>


