1
votes

I need to build a REST URI with multiple key-value search for MarkLogic server request. For Example, I have a XML document as below

<root>
    <id>10</id>
    <name>alex</name>
    <reg-no>123-45</reg-no>
    <city>New York</city>
    <state>NY</state>
    <occupation>student</occupation>
    <subject>NoSql</subject>
</root>

I can use keyvalue search like http://localhost:8000/v1/keyvalue?element=name&value=alex for single key-value.
What if I also need search for element state = NY? How can I search for multiple key-values in single REST call? How MarkLogic achieve this, What did they use for advanced search? Is structured query only the option?
Thanks in advance,
Prithvi.

1

1 Answers

3
votes

I suggest looking at QBE style querying:

http://docs.marklogic.com/REST/GET/v1/qbe

Or looking into using the normal search endpoint with for instance a structuredQuery:

http://docs.marklogic.com/REST/GET/v1/search

Note: the keyvalue endpoint has been deprecated since MarkLogic 8.

HTH!