Item11269: JQGridPlugin + MongoDB + large web + default sort = empty grid
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
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