Actually, I'll elaborate our more detailed solution.
1. We don't actually use POST requests for search, but our GET requests
have many fields and strange Dojo magic
2. We serialize the query with its many fields, using a bit of
compression on the URI query string, and base 64 encoding, into a
relatively opaque and relatively short token
3. This string is used by our search request handler, which unpacks the
string and allows a pageable search by merging in a few additional
fields (_page and _page_size) which are not serialized (that was
underscore magic). Because the serialized/compressed search query token
is opaque and you can't have two searches with the same query token, we
use this as a cache key extensively for performance.
We find this works well. Also, since we have a model object for the
search (with serialize/deserialize) we can create views on it which
allows us to generate nice textual descriptions of the search -- very
handy for user feedback. And our users like to keep a history using
these descriptions, so they can go back and look/run previous searches.
The only problem would appear to be when the URLs become excessive for a
GET request. When this happens, the POST can handle the form, generate
the serialized/compressed search query bundle, and then hand off to the
GET request with that instead.
One caveat we hit was Microsoft's IIS rejected path elements in URLs
which were more than 240 characters (bytes?) even the URL was sound. It
probably thought they might be files. So we did pass stuff as query
elements, as this seems to be more viable on Microsoft servers anyway.
--S
Stuart Watt
ARM Product Developer
Information Balance
On 6/2/2010 1:56 PM, [email protected] wrote:
Short version:
Using [% c.req.uri_with({ page => pager.next_page }) %] is fine for a
simple single-field search (where the form uses GET instead of
POST)... but how do we PAGE through (and/or cache) a multi-field form
search that uses POST?
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/