Hi, Manoj:

Thanks for clarifying.  We've wondered whether extension developers need an 
XQuery API for executing REST API functionality on the server.  I think this 
use case would benefit from precisely such an XQuery API.  Unfortunately, we 
don't have this XQuery API today.

At present, your alternatives are:

1.  Pass in the query options with the client request.

2.  Execute an xdmp:http-get() request for the options within your resource 
service extension code.

3.  Add a new service that saves a copy of the query options in a database at a 
location known to your resource service extension.  That is, the client would 
save the query options twice:  once with the standard endpoint and once with 
this new service.  Then, your query service can read the copy.  This adds to 
the cost of query options CRUD but keeps the query cost low.

4.  Reverse-engineer the MarkLogic code and call into the undocumented 
libraries or use fn:doc() to read the query options from the database.  Of 
course, this alternative has some dire downsides.  MarkLogic Support cannot 
help you if you run into any issues with that code path, and a future release 
may break your code.  I mention this alternative for completeness and to 
discourage it.

I would explore alternative 3.


Hoping that helps,


Erik Hennum

________________________________
From: [email protected] 
[[email protected]] on behalf of manoj viswanadha 
[[email protected]]
Sent: Thursday, April 25, 2013 3:05 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Clarrification on Extending the Rest API 
using Resource Service extention

Hi Erik,

My requirement is to use the constarints which are already configured in the 
REST Api  in the custom module which
i created using resource service extention.

so can i pass the options paramenter into the Resource service and use the 
constarints to filter the results.

consider the sample url below

http://localhost:<port number>/v1/resources/<service 
name>?param1=value&cosntarintname:<value>&options=<name>

Please suggest me if i am missing something.


Thanks,
Manoj.





On Wed, Apr 24, 2013 at 7:14 PM, Erik Hennum 
<[email protected]<mailto:[email protected]>> wrote:
Hi, Manoj:

I'm unclear how you would like to use "structured search on the custom 
modules."  Can you provide more detail about the service that you need to 
provide to the REST client?

A client can POST a structured search to a resource service extension, which 
can pass the payload to the search:resolve() function of the Search API.  
However, what would that give you that you can't get through the standard 
/v1/search endpoint?


Erik Hennum

________________________________
From: 
[email protected]<mailto:[email protected]>
 
[[email protected]<mailto:[email protected]>]
 on behalf of manoj viswanadha 
[[email protected]<mailto:[email protected]>]
Sent: Wednesday, April 24, 2013 12:53 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Clarrification on Extending the Rest API using 
Resource Service extention

Hi all,

I have a requirement to use structured query on the custom modules created using
Rest API. For this i have created a resource service where i have hosted my 
custom module on Rest API  and it is working as expected.

Can i use structured queries on created resource service as like general search 
in
Rest API?  I could not  find any information in Rest API tutorials. Can anyone 
one suggest me some solution for this.


Thanks,
Manoj Viswanadha.

_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to