Hi, Sini:
Instead of storing or converting the JSON representation, your export function
could send the original string search to the server and convert it there using
the search:parse() function:
http://docs.marklogic.com/search:parse
To execute the exported query, your could then pass the stored search:query or
cts:query and the search:options to search:resolve().
Hoping that helps,
Erik Hennum
________________________________
From: [email protected]
[[email protected]] on behalf of sini narayanan
[[email protected]]
Sent: Monday, February 11, 2013 5:34 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Search Query
Hi David,
Thanks. I have already gone through the search and rest-api guides. But I'm
still not able to figure out a solution for my requirement.
I have the an application built using app builder. I have done some
customization in the application. The customization is as below:
1. When a user performs a search and clicks on the "Export" link (custom link
created) in the results page, a new document is getting generated in the DB.
2. The new document created in the DB has the json query string as an entry in
it.
Example of the document in DB:
<QueryString>{"text":"","page":1,"facets":{"city":{"constraintType":"range","noShadow":true,"value":["Paris"]}}}</QueryString>
3. Now, what I need to know is, how do I reproduce my search results by
executing this json query string?
4. It is said that the json has to be converted into xml. Which is the function
that I should use, json:transform-from-json() OR xdmp:from-json?
5. If I get an xml format, how do I call the search:search to perform the
query. In the above example, I need to search for city:Paris.
Please help.
Thanks,
Sini
On Mon, Feb 11, 2013 at 5:51 PM, David Lee
<[email protected]<mailto:[email protected]>> wrote:
Ultimately AppBuilder ends up using search:search or cts:search in "the back
end" (MarkLogic DB).
JSON is converted to XML to perform the searches.
A good start for understanding search concepts from the server perspective is :
http://docs.marklogic.com/guide/search-dev
JavaScript code in AppBuilder uses the REST API which under the hood uses the
above.
http://docs.marklogic.com/guide/rest-dev
-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]<mailto:[email protected]>
Phone: +1 812-482-5224<tel:%2B1%20812-482-5224>
Cell: +1 812-630-7622<tel:%2B1%20812-630-7622>
www.marklogic.com<http://www.marklogic.com/>
From:
[email protected]<mailto:[email protected]>
[mailto:[email protected]<mailto:[email protected]>]
On Behalf Of sini narayanan
Sent: Sunday, February 10, 2013 11:57 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Search Query
Hi all,
How exactly is the search happening at the backend when we search for a
particular document in the application builder?
Is it in json format or something else. Please calrify.
In the controller.js file, I noticed that the query string formed is in json
format. Is this json query converted into some other format to search the DB?
If I have a json query, how do I search DB with the same.
For example: If i have the json query like below, can I use the same to query
the DB seperately in QC.
{"text":"","page":1,"facets":{"city":{"constraintType":"range","noShadow":true,"value":["Paris"]}}}
Thanks,
Sini
_______________________________________________
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