Anshu, Your question is misleading because the values are not duplicates.
"Reviews of Physiology Biochemistry" "Reviews of Physiology, Biochemistry" These two examples are different values, and in the string range indexes you have tried, they are each indexed separately. The system is behaving as designed. I think what you want to do is to ignore certain differences between strings, such as punctuation, and perhaps also whitespace, diacritics, and case. The way to achieve this is with a specific collation for your string range index. I suggest you read over section 21 of the Search Developer's Guide "Encodings and Collations": http://developer.marklogic.com/pubs/4.2/books/search-dev-guide.pdf Probably the easiest way to specify a collation is by using the collation builder in the administration app. There should be a button next to the place where you specify the collation on the range index you are creating. Note that it is possible to have multiple string range indexes on the same element with different collation specifications if you need to. One thing to note is that you cannot control which value is stored in the range index. So, in your example above, either might be stored as the value with entries for multiple documents. By specifying that punctuation should be ignored, you are essentially saying that it doesn't matter which one you use. Kelly Message: 2 Date: Thu, 23 Jun 2011 03:17:27 +0100 From: Anshu Raheja <[email protected]> Subject: Re: [MarkLogic Dev General] String range index contains duplicate values To: General MarkLogic Developer Discussion <[email protected]> Cc: Steve Mallen <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset="utf-8" Hi All, Can someone please shred somelight on what am i missing in the below mention query and receiving duplicate values or getting title as result which doesn't have , in it however i search for a title which has , present in it. Thanks, Anshu On 22/06/2011 17:01, Anshu Raheja wrote: > Hi All, > > I am facing similar issue of duplicate values while trying to execute > element-value-query. i am using following to create > element-value-query in search:search : > <constraint name="title"> > <value> > <element ns="http://xyz" name="title"/> </value> </constraint> ho I am > searching for following text as title : "Reviews of Physiology, > Biochemistry". > > The result contains items with , and without , in the search term, e.g: > "Reviews of Physiology Biochemistry" > "Reviews of Physiology, Biochemistry" > > I have tried the same search with cts:element-value-query and that > works perfectly fine and gives the results for the exact string value > passed(either with , or without ,) as title. > > I also tried to resolve this with changing string range index root > collation to unicode collation but didn't get any joy. > > Please Advice! > > Thanks, > Anshu* _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
