Package nzilbb.labbcat.server.api
Class Search
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.Search
-
public class Search extends APIRequestHandler
/api/search : Starts a search task to identify matches for the given search matrix.The search matrix defines a pattern of annotations to identify, which transcripts to search, and which participant's utterances to target. Additional search parameters can also be defined; whether to return only aligned matches, whether main-participants only are being targeted, etc.
Input HTTP parameters:
- searchJson - A JSON-encoded reprentation of the search matrix.
- search - An alternative to searchJson, this encodes an orthography-layer-only search as a plain-text string.
- mainParticipantOnly - Optional: specify a value (e.g. "true") if only main-participant utterances should be searched, absent otherwise.
- offsetThreshold - Optional minimum alignment confidence for matching word or segment annotations. A value of 50 means that annotations that were at least automatically aligned will be returned. Use 100 for manually-aligned annotations only, and 0 or no value to return all matching annotations regardless of alignment confidence.
- matchesPerTranscript - Optional maximum number of matches per transcript to return, or absent to return all matches in each transcript.
- overlapThreshold - Optional (integer) percentage overlap with other utterances before simultaneous speech is excluded, or absent to include overlapping speech.
- maxMatches - Optional maximum number of transcripts to include results for.
- suppressResults - Optional: Specify a value (e.g. "true") to return a summary of results only, instead of listing specific matches.
- participantQuery - Optional AGQL expression for defining which
participants to search the utterances of,
e.g.
first('participant_gender').label == 'NB'
- participant_expression - Deprecated synonym for participantQuery.
- transcriptQuery - Optional AGQL expression for defining which
transcript to search,
e.g.
['CC','IA'].includesAny(labels('corpus'))
- transcript_expression - Deprecated synonymn for transcriptQuery.
- only_main_speaker - Deprecated synonym for mainParticipantOnly.
- matches_per_transcript - Deprecated synonym for matchesPerTranscript.
- overlap_threshold - Deprecated synonym for overlapThreshold.
- num_transcripts - Deprecated synonym for maxMatches.
- suppress_results - Deprecated synonym for suppressResults.
- only_aligned - Deprecated: specifying a value (e.g. "true") is equivalent to specifying offsetThreshold with a value of "50".
Output: a JSON-encoded response object of the usual structure for which the "model" is an object with a "threadId" attribute, which is the ID of the server task to monitor for results. e.g.{ "title":"search", "version" : "20230502.0924", "code" : 0, "errors" : [], "messages" : [], "model" : { "threadId" : "80" } }
The task, when finished, will output a URL for accessing the matches of the search.- Author:
- Robert Fromont
-
-
Field Summary
-
Fields inherited from class nzilbb.labbcat.server.api.APIRequestHandler
SC_BAD_REQUEST, SC_CONFLICT, SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_METHOD_NOT_ALLOWED, SC_NOT_FOUND, SC_OK, SC_UNPROCESSABLE_CONTENT, SC_UNSUPPORTED_MEDIA_TYPE
-
-
Constructor Summary
Constructors Constructor Description Search()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.json.JsonObject
get(RequestParameters parameters, Consumer<Integer> httpStatus)
The GET method for the servlet.-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
GetSystemAttribute, init, writeResponse
-
-
-
-
Method Detail
-
get
public javax.json.JsonObject get(RequestParameters parameters, Consumer<Integer> httpStatus)
The GET method for the servlet.- Parameters:
parameters
- Request parameter map.httpStatus
- Receives the response status code, in case or error.- Returns:
- A JSON object as the request response.
-
-