Pubi
Pubi

Reputation: 11

sphinx sort with sql_attr_str2ordinal at textual unicode field

i'm using sql_attr_str2ordinal for textual field, so i can do sort. I have read the documentation that explains how it works.(using the bytes etc...) if i understand that correct, it is impossible to sort textual field by locale? How it's possible to achive that?

Sorting example(look for č letter): wrong sort: a b c d e . . . z č

right sort: a b c č d e . . . z

From docs:

Ideally the strings should be sorted differently, depending on the encoding and locale. For instance, if the strings are known to be Russian text in KOI8R encoding, sorting the bytes 0xE0, 0xE1, and 0xE2 should produce 0xE1, 0xE2 and 0xE0, because in KOI8R value 0xE0 encodes a character that is (noticeably) after characters encoded by 0xE1 and 0xE2. Unfortunately, Sphinx does not support that at the moment and will simply sort the strings bytewise.

Upvotes: 1

Views: 433

Answers (1)

barryhunter
barryhunter

Reputation: 21091

You can now use string attributes for sorting.

There is collation settings to effect this. http://sphinxsearch.com/docs/current.html#collations

the documentation in str2ordinal hasnt been updated to note it.

Upvotes: 1

Related Questions