Add query routes to support legacy bookmarks
Issue
In legacy CRDL, we supply bookmarks for queries and of course people can cut and past from the url. To support these in the new CRDL, we can add new routes, e.g.,
http://crdl.usg.edu/cgi/crdl?query=id: and http://crdl.usg.edu/query:id:
These should be special-cased to do what the new id:
route does, i.e., redirect to the record
route
http://crdl.usg.edu/cgi/crdl?query=???? and http://crdl.usg.edu/query:????
These can be the last ones caught in the routes. The ????
part can be parsed in such a way that we can put the keywords in the search box and perform that search.
This parsing can do the following:
- anything in single or double quotes are keywords
- any term--not in quotes--that ends in colon
:
can be stripped--these are legacy index labels, e.g.,kw:
- boolean operators--not in quotes--
and
,&
,or
,|
, andnot
,!
--REGARDLESS OF CASE--can be stripped - the keywords that remain can go in the search box--maybe with punctuation removed (?)
The above parsing isn't perfect, but will probably approximate most cases. All of this is to avoid just giving a 404 error.
Edited by Brad Baxter