Share » Forums » Extensions » eZ Find » Problems using sort_by

Problems using sort_by

Problems using sort_by

Friday 26 June 2009 5:05:50 am - 2 replies

Author Message

Tuomo Syvänperä

Monday 29 June 2009 2:28:28 am

Okay, more problems... It seems that ä and ö (scandinavian characters) also get sorted wrong. If the word starts with ä, it will get sorted as a. Don't know if it has something to do with transliteration and transformations. I have mapped ä to a and not ae as it is by default. But the search index should not index it as transformed, it should use the untransformed version of the name..

Tuomo Syvänperä

Wednesday 01 July 2009 5:03:11 am

Here's a quick way to reproduce the problem I have with sorting.. If anyone can confirm this, I'll file it in the issue tracker.
In default ezwebin - installation, create a few Product - class objects under for example Products/Software - node.
Use for example the following names for the products (or something similar)
aaaaaa
aa-bb
aa-cc
ba-ab
bbbbb
ccccccccc
ffffffffffffffff
ff gg
gaga
gg ff
gggggg
OS Type I
Test-Product

The OS Type I is one of the default objects..
Now if you use the following ezfind fetch:

{def $srch=fetch('ezfind', 'search', hash(
            'query', '',
            'limit', 20,
            'subtree_array', array(70),
            'class_id', 'product',
            'sort_by', hash('product/name', 'asc')
            ))}

{foreach $srch.SearchResult as $s}
    {$s.name}<br />
{/foreach}

70 is the node id for products/software in default ezwebin install.
What you end up with is a list of products which are certainly not ordered correctly.. What I get is this:
aaaaaa
ba-ab
aa-bb
bbbbb
aa-cc
ccccccccc
ffffffffffffffff
gaga
ff gg
gg ff
gggggg
Test-Product
OS Type I

What you will get may vary.. It seems there's absolutely no logic to the sorting. Sometimes names with dashes and or whitespaces get ordered correctly and sometimes the get ordered according to the string after the dash or whitespace..

Can anyone confirm this as a bug?

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu