Reputation: 976
I am using fn:distinct-values
but I have faced case sensitive problems.
I need to remove the duplicate values in MarkLogic db.
Result : Antony antony
but I want to one result without any duplicate either:
Antony or antony.
Upvotes: 1
Views: 336
Reputation: 4912
If this is just a small set of values, you don't have to create a lexicon for this: distinct-values
also takes a collation
parameter:
distinct-values(("anthony","Anthony"),"http://marklogic.com/collation//S1")
Upvotes: 5
Reputation: 7770
It's all about collations.
I would suggest that you add a lexicon to whatever attribute or element or property you are referring to. When you set up the lexicon, you can then define the collation to take care of this. In the end, no 'distinct values' is needed because the lexicon will already have a distinct list.
You could use 'distinct values' if you were to normalize your content using uppercase or lowercase in a FLWOR statement in your code, but this is much more costly.
For your reference:
https://docs.marklogic.com/guide/search-dev/encodings_collations https://docs.marklogic.com/guide/search-dev/lexicon
Upvotes: 4