Question

Domino Data Service is a good thing but is it possible to search for documents by key. I didnt find anything in the api and the url parameters about it.

Was it helpful?

Solution 2

You would do something like the following:

GET http://HOSTNAME/DATABASE.nsf/api/data/documents?search=QUERY&searchmaxdocs=N

N would be the total number of documents to return and QUERY would be your search phrase. The QUERY would be the same as doing a full text search.

For column lookups it should be something like this:

GET http://HOSTNAME/DATABASE.nsf/api/data/documents?sortcolumn=COLUMN&sortorder=ascending&keys=ROWVALUE&keysexactmatch=true

COLUMN would be the column name. ROWVALUE would be the key you are looking for.

There are further options for this. More details here.

http://infolib.lotus.com/resources/domino/8.5.3/doc/designer_up1/en_us/DominoDataService.html#migratingtowebsphereportalversion7.0

OTHER TIPS

I tried the above and the requests usually fail on the server timeout after 30 seconds. Calls to /api/data/documents won't serve the purpose with parameters like sortcolumn or keysexactmatch, therefore calls to
/api/data/collections should be used for these. Also, I don't think that arguments like sortcolumn would work on a document collection, because there isn't a column to be sorted in the first place, columns are in the views and not in documents, so view collection should be queried instead. That also mimics the behavior of getDocumentByKey method, which can't be called against document, but against the view. So instead:

http://HOSTNAME/DATABASE.nsf/api/data/documents?search=QUERY&searchmaxdocs=N

I would call

http://HOSTNAME/DATABASE.nsf/api/data/collections/name/viewname?search=QUERY&searchmaxdocs=N

and instead of

http://HOSTNAME/DATABASE.nsf/api/data/documents?sortcolumn=COLUMN&sortorder=ascending&keys=ROWVALUE&keysexactmatch=true

I would call:

http://HOSTNAME/DATABASE.nsf/api/data/collections/name/viewname?sortcolumn=COLUMN&sortorder=ascending&keys=ROWVALUE&keysexactmatch=true

where 'viewname' is the name of the view that is searched. That is much faster, which comes in handy when working with larger databases.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top