Hi,I was able to define the operator with following XML <options xmlns="http://marklogic.com/appservices/search"> <operator name="sort"> <state name="postedon"> <sort-order type="xs:date" direction="ascending"> <json-property>postedon</json-property> </sort-order> </state> </operator></options> I can confirm this when I check in http://localhost:8040/v1/config/query But now I am not able to use it in my Search API, I am using the following url to verify the sort orderhttp://localhost:8040/v1/search?q=2015%20sort:postedon I am not getting any results with the sort:postedon. I have create Element Range index & Field Range index on postedon of type date. Do I need any other index to influence the sort order of my results? is the definition of the operator right?Any tips on debugging it further would be helpful. regards,Puneet From: [email protected] To: [email protected] Date: Sat, 9 May 2015 21:21:26 +1000 Subject: [MarkLogic Dev General] Search API : defining a new operator
Hi,I am trying to define an operator sort:postedon to sort the search results in descending order of the date (json-property is postedon). I am using ML8 and my data is JSON files only. Following is my xml file <options xmlns="http://marklogic.com/appservices/search"> <search:operator name="sort"> <search:state name="postedon"> <search:sort-order direction="descending" type="xs:date"> <search:element ns="" json-property="postedon"/> </search:sort-order> <search:sort-order> <search:score/> </search:sort-order> </search:state> </search:operator></options> And I am applying this search option using following command curl -v -X PUT --digest --user admin:admin -H "Content-type: application/xml" -d @./SortOrder.xml 'http://localhost:8040/v1/config/query/sortorder' On running the command I am getting the following error {"errorResponse":{"statusCode":500, "status":"Internal Server Error", "messageCode":"INTERNAL ERROR", "message":"XDMP-DOCNONSBIND: xdmp:get-request-body(\"xml\") -- No namespace binding for prefix search at line 1 . See the MarkLogic server error log for further detail."}} Following is the entry in the server log 2015-05-09 21:05:49.176 Notice: carsearch: XDMP-DOCNONSBIND: xdmp:get-request-body("xml") -- No namespace binding for prefix search at line 12015-05-09 21:05:49.176 Notice: carsearch: in /MarkLogic/rest-api/endpoints/config-query.xqy, at 42:9 [1.0-ml]2015-05-09 21:05:49.176 Notice: carsearch: $headers = map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:map="http://marklogic.com/xdmp/map"><map:entry key="content-type"><map:value xsi:type="xs:string">ap...</map:map>)2015-05-09 21:05:49.176 Notice: carsearch: $method = "PUT"2015-05-09 21:05:49.176 Notice: carsearch: $params = map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:map="http://marklogic.com/xdmp/map"><map:entry key="named-option"><map:value xsi:type="xs:string">so...</map:map>) I am following the examples in manuals athttps://docs.marklogic.com/guide/search-dev/query-options#id_30002 is the namespace "http://marklogic.com/appservices/search" right? Any tips to resolving it would be useful.regards,Puneet _______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
