[pmwiki-users] Re: Weird search result

chr at home.se chr at home.se
Tue Nov 1 13:58:29 CST 2005


On Tue, 1 Nov 2005, Patrick R. Michaud wrote:

> On Tue, Nov 01, 2005 at 04:25:12PM +0100, Roman wrote:
> > Wierd is that although group and page names in links are case
> > insensitive, pagelist is case sensitive. That's why "Pmwiki" is
> > considered as a different group. I think that all pages in your
> > example should be listed within one group.
> 
> Except that "Pmwiki" is in fact a different group from "PmWiki",
> so that'd be misleading.
> 
> I don't have a quick fix for this problem because it's a result
> of the way PHP is performing string comparisons, which in turn
> depends on the site's locale setting.  For the en_US locale, which 
> is what pmwiki.org is using, string comparisons in sort are therefore
> case insensitive by default.
> 
> I can probably force the sort algorithm to do a case-sensitive sort,
> but in doing so we'd probably end up losing all of the other
> very useful locale-based sorting features -- i.e., "é" would then
> sort after "z".  I think the present situation is probably
> better.  And the fact that the group name is called out in the
> middle helps to highlight the fact that there are in fact two
> groups with the same name and something probably needs to be fixed.

As long as you're aware of this "feature"...

Btw, shouldn't it be possible to do the sorting in a three-step manner as
follows? First split up the search result (array of page names?) according
to the group name (case sensitively), resulting in an array of arrays.  
Then sort the first array (of group name) according to the current locale.  
Finally, for each group, sort the page names according to the current
locale.

I'm not sure if it's worth the effort however...

/Christian

PS. I tried deleting Pmwiki/RecentChanges the normal way, but that only 
caused the page to be recreated... maybe you can delete it?

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr






More information about the pmwiki-users mailing list