Hi David, Thanks for your response. Here is the xml: <multilanguage> <language><value xml:lang="zh">丁2橡胶</value> <value xml:lang="en">third</value></language> <language><value xml:lang="zh">丙酸异辛酯</value> <value xml:lang="en">tenth</value></language> <language><value xml:lang="zh">丁烯</value> <value xml:lang="en">first</value></language> <language> <value xml:lang="en">sixth</value></language> <language><value xml:lang="zh">丙酸 丁酯</value> <value xml:lang="en">seventh</value></language> <language><value xml:lang="zh">丁苯胶</value> <value xml:lang="en">fourth</value></language> <language><value xml:lang="en">eleventh</value></language> <language><value xml:lang="zh">丁1橡胶</value><value xml:lang="en">second</value></language> <language><value xml:lang="zh">丙</value> <value xml:lang="en">1</value></language> <language><value xml:lang="zh">丙~</value> <value xml:lang="en">fifth</value></language> <language><value xml:lang="zh">丙 乙酯</value> <value xml:lang="en">eighth</value></language> </multilanguage>
I need to sort the above xml based on the value element for xml:lang="zh" or xml:lang="en" depending on some inputs. How can I do this in MarkLogic. What FLWOR will be needed for both language sorting. Also I am thinking to have to range indexes with different collations(1 for zh and other for en) is this the right way to solve this. Regards, Ashish On Tue, Jun 10, 2014 at 4:14 PM, David Ennis <[email protected]> wrote: > HI. > > Separate from language support, you can specify the collation to use on > specific string indexes. > > https://docs.marklogic.com/guide/search-dev/encodings_collations > > In my opinion, This is really the magic needed for granular control > sorting. > > As well as defaults, you can define the collation on the index and then > refer to a specific collation in your search. > > Let me know if this helps. Otherwise, provide an XML sample and how you > want it sorted. Then there will be enough information for someone to > provide a proper sample. > > Kind Regards, > David Ennis > > > On 10 June 2014 12:16, Ashish Bhardwaj <[email protected]> wrote: > >> Hi, >> >> Can anyone tell me what are the ways of doing a language specific sorting >> on a particular data using Marklogic XQuery? >> >> I am new to MarkLogic and have gone through a lot of documentation around >> collations in Marklogic but how to run a query which can do language >> specific sorting is something which is nowhere mentioned in documentation. >> I would appreciate if someone can give me a few examples. >> >> Thanks, >> Ashish >> >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> >> > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > >
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
