Cool URLs

The front-end tries to keep the URLs looking sleek and easy to understand. They are described below.

Searching

Search queries are handled entirely by AJAX. The main URL for a search takes this form:

/search/query/filter.field1/filter.value1/filter.field2/filter.value2

There can be an arbitrary number of filters.

For example, a search for noah webster, filtered by location might look like this:

/search/noah+webster/geographic/amherst

Browsing

Browsing works exactly like searching, except that the Solr request handler is configured to emulate 'browsing' behavior. Like with searching, browsing queries are handled exclusively by AJAX request. For example:

/browse/filter.field1/filter.value1/filter.field2/filter.value2

There can be an arbitrary number of filters.

For example, browsing the 'Art and Architecture' (PID=collection:vr) collection might involve a location like this:

/browse/collection/vr/geographic/london

Viewing

Object viewing uses a very simple URI pattern:

/view/PID

TODO: carry over some state from the previous search/browse query in order to allow users to access the next search result item, such as:

/view/PID/search/noah+webster

Everything following the PID would be optional.

JSON Requests

Much of the functioning of the site will consist of JSON requests. This is particularly true of the search and browse interfaces. Those pages will use the backend API for requesting data. These requests will follow this general format:

/api/{method}/{query}/{numResults}/{page}/{filter.field1}/{filter.value1}

Search Request

Here is an example of a search request for the first 21 items matching the query 'noah webster' and filtered by 'mods.geographic:amherst'

/api/search/noah+webster/21/0/geographic/amherst

Browse Request

An example of a browse request for the second page of 21 items in the Art and Architecture collection, filtered by 'mods.genre:painting'

/api/browse/21/1/genre/painting/collection/collection:vr

Or, do the same query across all collections:

/api/browse/21/1/genre/painting

Similar Items Request

An example of 'related items', based on PID: vr:9310, requesting the first page of two items. In this case, there are no filters.

/api/similar/vr:9310/2/0
url_formats.txt · Last modified: 2014/01/22 15:29 by acoburn
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International