Neel Bavishi
Neel Bavishi

Reputation: 1

how to search documents and update metadata using REST API in MarkLogic server?

How can I assign documents obtained by a QBE to a collection using REST API in MarkLogic Server? I currently use this QBE:

<q:qbe xmlns:q="http://marklogic.com/appservices/querybyexample">
  <q:query><ALBUM>Pop</ALBUM></q:query>
  <q:response><q:extract><TITLE></TITLE></q:extract></q:response>
</q:qbe>

If QBE cannot be used, what else can I use to search document by some criteria and update the collection metadata therein?

Upvotes: 0

Views: 208

Answers (1)

ehennum
ehennum

Reputation: 7335

You can use QBE to bring back a list of documents to the client.

You can then do a bulk write that updates the collections on those documents (but not the content or other metadata).

Bulk update of metadata in the REST API is described here:

http://docs.marklogic.com/guide/rest-dev/bulk#id_88873

The Java and Node.js APIs provide an interface for bulk update of metadata.

The best approach is to page through the matching documents in batches of 100.

Hoping that helps,

Upvotes: 2

Related Questions