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 <erik.hen...@marklogic.com>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:* general-boun...@developer.marklogic.com [ > general-boun...@developer.marklogic.com] on behalf of manoj viswanadha [ > manoj.viswana...@gmail.com] > *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 > General@developer.marklogic.com > http://developer.marklogic.com/mailman/listinfo/general > >
_______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general