Hi sd, You need to use <path-index> instead of <element> inside the range constraint. See also the documentation of search options:
http://docs.marklogic.com/search:search?q=search:search&v=8.0&api=true#opt-constraint Look for range constraint, and then locate the last example. Cheers, Geert From: Shashidhar Rao <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Saturday, April 4, 2015 at 7:06 PM To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: Re: [MarkLogic Dev General] Range index for duplicate element for facets how to Just created path range indexes for the above date, and was trying to write the options through QueryOptionsManager writeOptions method, but for Range index it is working but for Path range index the options is giving me java.lang.NullPointerException My Path Range Index settings. scalar type = string path expression = "product-reference/date" collation ="http://marklogic.com/collation/" Options I want to write through QueryOptionsManager <?xml version="1.0" encoding="UTF-8"?> <options xmlns="http://marklogic.com/appservices/search" > <constraint name="date"> <range type="xs:string" collation="http://marklogic.com/collation/"> <element ns="" name="product-reference/date"/> </range> </constraint> </options> Appreciate if someone could help me fix this issue. I had gone through the documentation but could not find the options xml for Path range index. Maybe the <range> is not what is expected for Path range index. Thanks sd On Sat, Apr 4, 2015 at 6:47 PM, Shashidhar Rao <[email protected]<mailto:[email protected]>> wrote: Could some help me with creating the range index for a duplicated nested element A snippet of my xml structure is given below and I want to create range index for the date under the <product-reference> for the facets and not the date under the <store-reference> . How should I do it . Appreciate if some could help me out. 2. Is it still possible for me to create both the date as range indexes which one marklogic will pick up if I create range indexes for both date under <product-reference> and date under <store-reference>. <product-reference> <product-id> <country>IND</country> <product-number>AA-503</product-number> <product-type>apparel</product-type> <date>20130105</date> </product-id> </product-reference> <store-reference> <store-id> <country>JP</country> <store-number>8369</store-number> <date>20120906</date> </store-id> </store-reference> thanks sd
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
