Hi

We are having MarkLogic REST Search as below on the following document.

Content:
<root>
                <data>
                <p search="true">paragraph</p>
                <p search="true">paragraph</p>
</data>
                <images>
                <img search="true">image</img>
                <img search="true">image</img>
</ images >
</root>

We need to search for all the elements that have "search" as attribute. We need 
to exclude 'img' tags in the xml. So we are using 'searchable-element' to 
restrict the 'img' tags.
Options: search.xml
<options xmlns="http://marklogic.com/appservices/search";>
  <term apply="term">
    <empty apply="all-results"/>
    <term-option>case-insensitive</term-option>
  </term>
  <searchable-expression>//*[@ssearch and local-name(.) ne 
"img"]</searchable-expression>
</options>

Issue:
We see the total number of results varying when we change the 'start' parameter 
value

http://host:port/v1/search?q=&collection=Pages&options=search&format=xml&start=1&pageLength=10
<search:response xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns="" 
xmlns:search="http://marklogic.com/appservices/search"; snippet-format="raw" 
total="6390" start="1" page-length="10">
http://host:port/v1/search?q=&collection=Pages&options=search&format=xml&start=11&pageLength=10
<search:response xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns="" 
xmlns:search="http://marklogic.com/appservices/search"; snippet-format="raw" 
total="6395" start="11" page-length="10">
http://host:port/v1/search?q=&collection=Pages&options=search&format=xml&start=21&pageLength=10
<search:response xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns="" 
xmlns:search="http://marklogic.com/appservices/search"; snippet-format="raw" 
total="6401" start="21" page-length="10">

However, on using unfiltered search we don't see the issue with "total" number 
of results, but the img tag is being returned in the search. It should be 
excluded in the search results.
<search-option>unfiltered</search-option>

We need img tags to be eliminated with correct number of "total" results for 
each search.

Thanks
Rahul

This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful. Where permitted by applicable law, this e-mail 
and other e-mail communications sent to and from Cognizant e-mail addresses may 
be monitored.
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to