Item11269: JQGridPlugin + MongoDB + large web + default sort = empty grid

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: JQGridPlugin, MongoDBPlugin
Branches:
Reported By: PaulHarvey
Waiting For:
Last Change By: MichaelDaum
There's a subtle difference in the way MongoDBPlugin interprets an undefined sort param vs the core SEARCH implementation.

On MongoDB, it results in a request to sort on a field that isn't indexed, and on large webs this can result in an empty grid.

diff --git a/lib/Foswiki/Plugins/JQGridPlugin/SearchConnector.pm b/lib/Foswiki/Plugins/JQGridPlugin/SearchConnector.pm
index c874f3b..ae11855 100644
--- a/lib/Foswiki/Plugins/JQGridPlugin/SearchConnector.pm
+++ b/lib/Foswiki/Plugins/JQGridPlugin/SearchConnector.pm
@@ -97,7 +97,7 @@ sub restHandleSearch {
     }
   }
 
-  my $sort = $request->param('sidx') || '';
+  my $sort = $request->param('sidx') || 'Topic';
   my $sord = $request->param('sord') || 'asc';
   my $reverse = ($sord eq 'desc'?'on':'off');
 

-- PaulHarvey - 21 Nov 2011

Better implement a MongoDBConnector rather than using the SearchConnector, which is going to be slower in any case.

-- MichaelDaum - 09 Sep 2016
 

ItemTemplate edit

Summary JQGridPlugin + MongoDB + large web + default sort = empty grid
ReportedBy PaulHarvey
Codebase trunk
SVN Range
AppliesTo Extension
Component JQGridPlugin, MongoDBPlugin
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r3 - 09 Sep 2016, MichaelDaum
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