Suppose I have a xml as below:
<xx>
<yy>
<name>A</name>
<value>1</value>
</yy>
<yy>
<name>A</name>
<value>2</value>
</yy>
<yy>
<name>B</name>
<value>1</value>
</yy>
</xx>
Now I want to find if any 'yy' is present with name as A and value as 1. So here the matching content would be:
<yy>
<name>A</name>
<value>1</value>
</yy>
I am trying to do this by REST call,qbe GET request but not able to do it. Can some one help me out using:
/v1/qbe
or
/v1/search
With the /v1/search API you'll need to use custom search options to achieve this.
To upload custom search options to MarkLogic: http://developer.marklogic.com/learn/rest/custom-search#search-using-an-element-value-constraint
Your search options will define constraints for your search based on the indexes you created. Your search options should look like this:
Let's say you upload these options as "mySearchOptions".
Finally, you can make this GET request to get the search results you want:
http://localhost:REST_SERVER_PORT/v1/search?q=yy%3A(name%3Aa%20AND%20value%3A1)&options=mySearchOptions