On 4 May 2013 21:23, Alexander Gabriel <[email protected]> wrote:
> O.k., I'll look this up. Thanks!
>
> In one of my couchapps people upload data and then it can take a while for
> the index to catch up. No data has to be downloaded then, so that case is
> all about following the updating of the index. And as I present links so
> the Users can check the result of the upload, I should also tell them when
> they can do this.
>
> I'd need a couchdb specific method for that, probably?
Some of these might be useful;
After the upload is complete, query the view with stale=update_after,
to trigger a view update. You can use &limit=0 to get an instant
return and not have to transmit any data back.
Or you can query the view and leave off the stale= part, when that GET
returns, your view is up to date.
Or if this user is the only one writing to the DB (classic local couch
style with replication elsewhere) you *could* use
update_seq=true&stale=ok and compare the update_seq with that of the
DB itself.
You can also see in _active_tasks the current state of a view being built;
{
"changes_done": 9346,
"database": "testy",
"design_document": "_design/simpleform",
"pid": "<0.31025.15>",
"progress": 41,
"started_on": 1367697289,
"total_changes": 22454,
"type": "indexer",
"updated_on": 1367697741
}
The first 2 options are probably your best bet.
http://wiki.apache.org/couchdb/HTTP_view_API#View_Generation_Options
A+
Dave