Hi Shibu,

We've all (correctly I think) been selling you on the Java and REST APIs, but the question you've asked has a simple answer -- yes of course its possible to do what you've asked!

search.xq in your scenario just needs to access a parameter and run a search based on that.

So this kind of expression will do what you're looking for:

let $text := xdmp:get-request-field("text")
return search:search($text, <options.... />)

The first line is how to put a field value into a variable. The second line is a search API call. I direct you to the Search Developer's Guide http://docs.marklogic.com/guide/search-dev for examples and docs on search:search.

Charles



On 01/23/2013 12:31 AM, Shibu N wrote:
Hi Friends,

I'm relatively new to marklogic and I have a requirement where I'll have to call a query on the server with parameters using the java API. I'm not sure of the best approach to do this either. whether to use java API/ REST API's.

The query is of the form http://localhost:8010/search.xq?text=searchtext

The query search.xq simply performs a search based on searchtext and returns the results,

Any tips would be helpful,

Thanks & Regards

Shibu



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

--
Charles Greer
Senior Engineer
MarkLogic Corporation
[email protected]
Phone: +1 707 408 3277
www.marklogic.com

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

Reply via email to