Hi,

How can I, restrict the default search of ML 6 rest API's?

I have created options custom-search.xml  file which contains constraint for 
AssestID, as below

<search:constraint name=" AssestID ">
    <search:custom facet="false">
      <search:parse apply="custom-query" ns="http://hmhpub.com/orgID"; 
at="/AssestID.xqy"/>
    </search:custom>
  </search:constraint>

Now, I want to hit below URL

http://localhost:9000/v1/search?q=reader  AND 
AssestID:1000&options=custom-search&format=xml&collection=Resource

Based on AssestID parameter in above search URL, I am calling my own xquery 
module AssestID.xqy ,where I am getting the resID (like id_1 , id_2) from 
database based on AssestID:1000 and manipulating the search query which gives 
me result from collection "Resource" with keyword "reader" AND "id_1" OR "id_2" 
and its working fine.

Now, I want, if I will not supply AssestID in search URL, it should return 
empty result. But currently it's not happing.
If I am not passing AssestID in the search URL it gives me the default search 
result with keyword "reader" from whole database.

So, here I want to restrict  ML 6 rest API's default search. How can I do that 
to achieve my goal??

Regards,
Asit Nautiyal
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.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to