You are here: Foswiki>Tasks Web>Item12418 (11 Feb 2015, GeorgeClark)Edit Attach

Item12418: Unexpected SEARCH ordering results

pencil
Priority: Normal
Current State: Needs Developer
Released In: n/a
Target Release: n/a
Applies To: Web Site
Component:
Branches:
Reported By: VickiBrown
Waiting For:
Last Change By: GeorgeClark
See the list of consultants at WikiConsultants.

Note the order of the first field (Name):
C-Dot Consultants
Xaan - Chris Vertonghen 
Alexander Weimer GmbH 
Arthur Clemens 

Also, BaSystem Martin Raabe falls where M is expected to be found, not under B.

The SEARCH code:

%SEARCH{
  "form.name~'*WikiConsultantForm'"
  nosearch="on"
  excludetopic="WikiConsultantTemplateTopic,Consultant"
  xorder="formfield(Name)"
  order="formfield(Country),formfield(Name)"

Unexpected:

  • Why do C-Dot and Xaan come before A?

  • Why two orderings? (order and xorder)

  • Is xorder a real option?
    I don't see xorder documented either for SEARCH or QuerySearch
    a search for xorder returns only 2 hits, both for WikiConsultantForm

  • when I add sort=on to the SEARCH parameters and click on the Name column, the sort order is as expected.

-- VickiBrown - 07 Mar 2013

xorder looks like a disabled order parameter. As for the multiple sort criteria, does that actually work? I don't think so - we have a proposal to do that, but no code to actually do it. In which case I think SEARCH is defaulting to a topic name-based sort.

Probably we should emit an alert in this case, rather than silently topic-sorting. Vicki, do you think that's appropriate?

-- PaulHarvey - 13 Mar 2013

cf. SupportMultiKeySorting and SearchOrderByTopicElement

-- PaulHarvey - 13 Mar 2013

Setting this to no action. The reason for the sort issues. Sort is by topic, name, but the consultant name from the formfield is displayed. The Topic name for Alexander is "ConsultantAlexander..." and Xaan is "Chris..." So the natural order is:

-- GeorgeClark - 30 Dec 2014

It's still unexpected from the user's point of view. An explanation isn't sufficient. The code needs to be changed to make the results look correct from the front.

Just because the code is working properly, doesn't mean the code is the right code.

-- VickiBrown - 30 Dec 2014
 

ItemTemplate edit

Summary Unexpected SEARCH ordering results
ReportedBy VickiBrown
Codebase 1.1.8, 1.1.7, trunk
SVN Range
AppliesTo Web Site
Component
Priority Normal
CurrentState Needs Developer
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r5 - 11 Feb 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy