search document by tag

I have updated my document, which is Test.pdf with the following metadata : transaction:date = “2050-12-25”, transaction:time = “16:00:00”, transaction:id = “aaaa-bbbb” Below the rest api:

PUT http://

{ “entity-type”: “document”, “properties”: {

"nxtag:tags": [
        {
            "label": "\"transaction:date\":\"2050-12-25\"",
            "username": "Administrator"
        },
        {
            "label": "\"transaction:time\":\"16:00:00\"",
            "username": "Administrator"
        },
        {
            "label": "\"transaction:id\":\"aaaa-bbbb\"",
            "username": "Administrator"
        }
    ]    

} }

Is anyone know how to search my document(Test.pdf) by transaction:id tag which is equal “aaaa-bbbb”? Any help will be appreciated.

0 votes

1 answers

1576 views

ANSWER



Hi,

you can use several service in Nuxeo to search. For example, with REST API endpoints or automation (${HOST}/nuxeo/site/automation/doc). Look for search into for REST API : https://doc.nuxeo.com/nxdoc/search-endpoints/

Look up here https://doc.nuxeo.com/nxdoc/nxql/ for ecm:tag use, with ecm:tag/* in NXQL language, and ready.

Hope it helps.

Regards, VS!

0 votes



Beware if using ElasticSearch : ecm:tag queries are not supported

Using the Tag service in order to store metadata seems weird to me, why don't you use … metadata ?

05/04/2018

Then, I recommend to you define a schema "transaction" (with prefix "transaction", i.e) in your document type with the metadata: transaction:date, transaction:time, transaction:id, to store this information instead. You'll be able to search by metadata using Elasticsearch.
05/04/2018