Hi, Manoj:

Passing a complete structured query in a single request is not supported in 
MarkLogic 6 but is under consideration for a future release.

If you must have this capability in MarkLogic 6, you could consider writing a 
resource extension that takes both query and options and invokes the Search API.


Erik Hennum
________________________________
From: [email protected] 
[[email protected]] on behalf of manoj viswanadha 
[[email protected]]
Sent: Wednesday, January 23, 2013 4:43 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Strcutured query on Ml-6 Rest API

Hi Erik,

Thanks for your quick reply. I want to use structured query without passing 
options. i want to directly pass everything in the
service as like corona structured query. Is there any way to use this rest API?

Thanks,
Manoj

On Tue, Jan 22, 2013 at 10:06 PM, Erik Hennum 
<[email protected]<mailto:[email protected]>> wrote:
Hi, Majoj:

A structured query has two parts:

*  Persisted query options that identify the indexes you're querying against.
*  A query that supplies the criteria and any boolean composers for the 
criteria.

This two-part structure makes it possible to supply the query either with
a Google-like string or with a structure.

In JSON, here's the options structure for an element value query:

{"options":{"constraint":[
    {"name":"YOUR_CONSTRAINT_NAME",
      "value":{"element":{
          "name":"YOUR_ELEMENT_NAME",
          "ns":"YOUR_ELEMENT_NAMESPACE"}}}]}}

Here's the query structure for an element value query:

{"query":{"queries":[
    {"value-constraint-query":{
        "constraint-name":"YOUR_CONSTRAINT_NAME",
        "text":["YOUR_CRITERIA_VALUE"]}}]}}

For more detail, please see:

    http://docs.marklogic.com/guide/rest-dev/search


Erik Hennum

________________________________
From: 
[email protected]<mailto:[email protected]>
 
[[email protected]<mailto:[email protected]>]
 on behalf of manoj viswanadha 
[[email protected]<mailto:[email protected]>]
Sent: Tuesday, January 22, 2013 1:28 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Strcutured query on Ml-6 Rest API

HI all,

I have explored the different Features on ML-6 Rest API.

I have a small requirement where i will be using strcuturedQuery with 
element-value-query.
I want to search my results based on the particular element which i tried using 
below.

http://localhost/v1/search?structuredQuery=
 {"query":
{"element-value-query":
  {"element-name":"name of the element",
"text":["some value"]}}}&collection=collectionname&format=xml

Above query should search for the element with particular value but its giving 
all the results in database.

Can anyone help me in achieving this or how we can use structured query with 
any cts:query.

Thanks,
Manoj.

_______________________________________________
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