Mímir XML Service (http://demos.gate.ac.uk:80/mimir)
This is the Mímir search Web Service on
http://demos.gate.ac.uk:80/mimir, searching index "Web Archive 1 Million".
You can also search this index using the web interface.
A call to this service consists of a normal HTTP connection to a URL like:
http://demos.gate.ac.uk/mimir/tna/search/action,
where the action value is the name of one of the supported actions, described below.
Parameters may be supplied as query parameters with a GET request or in
normal application/x-www-form-urlencoded form in a POST request.
Alternatively, they may be supplied as XML (if the request content type
is
text/xml or application/xml) of the form:
<request xmlns="http://gate.ac.uk/ns/mimir">
<firstParam>value</firstParam>
<secondParam>value</secondParam>
</request>
The first request to the service will return a session cookie, which
must be passed back with all subsequent requests.
help
Prints this help message.
Parameters: none
Returns: this help page.
postQuery
Action for starting a new query.
Parameters:
queryString |
the text of the query. |
Returns: the ID of the new query, if successful.
documentsCount
Gets the number of result documents.
Parameters:
queryId |
the ID of the requested query. |
Returns: -1
if the search has not yet completed, or the
total number of result documents otherwise.
documentsCurrentCount
Gets the number of result documents found so far.
Parameters:
queryId |
the ID of the requested query. |
Returns: the number of result documents found so far. After the search
completes, the result returned by this call is identical to that of
documentsCount
.
documentId
Obtains the document ID for the document at a
given rank (position in the results list).
Parameters:
queryId |
the ID of the requested query. |
rank |
the rank (position in the results list) for the requested document. |
Returns: ID of the requested document (an integer value).
documentScore
Obtains the score for the document at a
given rank (position in the results list).
Parameters:
queryId |
the ID of the requested query. |
rank |
the rank (position in the results list) for the requested document. |
Returns: the score for the requested document, a floating point
(double precision) value.
documentHits
Action for obtaining the hits for a given
document.
Parameters:
queryId |
the ID of the requested query. |
rank |
the rank (position in the results list) for the requested document. |
Returns: a list of hits, each defined by a document ID, a
termPosition, and a length.
documentText
Action for obtaining [a segment of] the text of a document.
Parameters:
queryId |
the ID of an active query, to be used as a context for this call. |
rank |
the rank (position in the results list) for the requested document. |
termPosition |
(optional) the index of the first token to be returned,
defaults to 0 if omitted, i.e. start from the beginning of the
document. |
length |
(optional) the number of tokens (and spaces) to be returned.
If omitted, all tokens from position to the end of the document will
be returned. |
Returns: the text of the document [segment] requested, as a
list of tokens and space pairs.
documentMetadata
Action for obtaining the document metadata.
Parameters:
queryId |
the ID of an active query, to be used as a context for this call. |
rank |
the rank (position in the results list) for the requested document. |
fieldNames |
(optional) a comma-separated list of other field names to be returned. |
Returns:
- the document URI
- the document title
- the values for the other field names, if requested and present
documentMetadata
Action for obtaining the document metadata.
Parameters:
documentId |
the document ID (as obtained from a call to the
documentId action) for the requested document. |
fieldNames |
(optional) a comma-separated list of other field names to be returned. |
Returns:
- the document URI
- the document title
- the values for the other field names, if requested and present
renderDocument
Renders the document text and hits, in the context
of a given query. The html of the document is rendered directly to the
response stream of this connection.
Parameters:
queryId |
the ID of the requested query. |
rank |
the rank (position in the results list) for the requested document. |
Returns: the HTML source of the rendered document.
renderDocument
Renders the document text outside of the context
of any given query. The html of the document is rendered directly to the
response stream of this connection.
Parameters:
documentId |
the document ID (as obtained from a call to the
documentId action) for the requested document. Finding
documents by ID is outside the scope of any query, so there will be no
hit highlights. |
Returns: the HTML source of the rendered document.
close
Action for releasing a query.
Parameters:
queryId |
the ID of the requested query. |
Returns: the exit state (success or error).