Search URL
The search request is initiated by passing a URL string to the LAARC catalogue web service.
The service url is
http://www.museumoflondon.org.uk/laarcWS/v1/rest.
The search criteria is defined in the query string part of the request URL as a list of name=value pairs.
Here is an example request url:
http://www.museumoflondon.org.uk/laarcWS/v1/rest?op=SearchSites&search_type=keywords&terms=knife,Roman&pageno=1&perpage=10
The part of the URL before the question mark(?) is the path to the search API application.
The part of the URL after the question mark (?) is a query string containing the query parameters.
Query String parameters
Operation (op) and Search Type (search_type) parameters
Parameters inherited by all search operations are op and search_type.
op is a high level search handler method to whom the search request is dispatched.
Its value has a standard format: SearchXXX, GetXXX
where XXX is the target domain object to feature in the search result.
For example, op=GetSites tells us that the target domain object is an archaeological site.
That is we expect a list of archaeological sites in the search result.
Our convention is that 'Search' part of the parameter name means text-based search
while 'Get' part means that we are looking for a collection related to the target object
by primary key or foreign key.
search_type specifies which other parameters the application expects
to follow in the url query string.
For example, if search_type is set to values "keywords", "bycode" or "bykey"
the application expects terms parameter.
The first release of the search API accepts only search_types
"keywords", "bycode" and "bykey".
This scheme is, however, the base for extention in order to formulate other types of searches in a uniform manner.
For example, in the future we may extend it with geographical search and/or filter-based search.
Certain api methods and certain parameters take lists of values as well as a single value.
The common format of passing a list as a query parameter is to separate items in it by commas.
For example, terms=knife,Roman
You can pass a word phrase, rather then a single word as a member of the list of terms.
Words in a phrase are concatenated with a plus(+)sign.
For example, terms=roman+knife,blade is equivalent to a term list that consists
of a word phrase and a single word - roman knife, blade
Pagination parameters (pageno and perpage)
All queries that return a list of results are paged. By specifying parameters pageno and perpage
we tell the API which portion of the result set we are looking for.
pageno is the page to start from.
perpage is how many results are included in one page.
Parameters pageno and perpage are optional.
If not specified the API defaults pageno parameter to value 1 and
perpage to the API pre-set maximum value of the perpage parameter.
If pageno value exceeds the total number of pages that the results are paged
into the last page of the paged result set will be returned.