Auto-Completion API
These endpoints suggest relevant results for auto-completing a user’s search. They are used by the front end to improve the user experience.
Note: These endpoints require authentication which has been deliberately excluded from the examples below.
Get auto-completion results
GET /typeahead
Searches the underlying index and suggests results for auto-completion.
Request Parameters
query
(string, required): The search query.type
(string, optional, default:query
): Specifies how thequery
parameter is interpreted.limit
(integer, optional, default: 100): Maximum number of results.offset
(integer, optional, default: 1): 1-based offset.fields
(string, optional): Fields to apply the query on (supports wildcards).type-filter
(string, optional): Entity/identifier type to filter by.is-type-filter-base64
(boolean, optional, default:false
): Iftrue
, thetype-filter
will be Base64 decoded.type-filter-mode
(string, optional, default:any
): Specifies whether to filter byentity
,identifier
, orany
.range-start
(string, optional): Specifies the start of a range to filter results.range-end
(string, optional): Specifies the end of a range to filter results.range-fields
(string, optional): Fields to apply the range filter on.show-security-labels
(boolean, optional, default:false
): Iftrue
, security labels will be returned.indices
(string, optional): Specific indices to apply the operation on.
Example Call
curl -X GET https://telicent.core.domain/api/search/typeahead?query=docu&limit=5&fields=title
Response
Description
- 200 OK: Search was successful. Contains
SearchResults
object. - 400 Bad Request: Invalid search parameters or unsupported query type/feature.
- 500 Internal Server Error: Server failed to process the request.
- 503 Service Unavailable: No underlying search index available.
Get (POST) Auto-completion results
POST /typeahead
Identical functionality to GET /typeahead
, but allows parameters to be submitted via an application/x-www-form-urlencoded
POST request.
Request Body (application/x-www-form-urlencoded)
query
(string, required): The search query for typeahead suggestions.query-type
(string, optional): Type of query to perform.limit
(integer, optional): Number of results to return.offset
(integer, optional): Offset for paginated results.fields
(array of string, optional): List of fields to constrain the search.type-filter
(array of string, optional): Filters results by type.is-type-filter-base64
(boolean, optional): Indicates if type filter values are Base64 encoded.type-filter-mode
(string, optional): How type filters should be applied.range-start
(string, optional, format:date-time
): Start of the date range.range-end
(string, optional, format:date-time
): End of the date range.range-fields
(array of string, optional): Fields used for range filtering.show-security-labels
(boolean, optional): Indicates whether security labels should be included.indices
(string, optional): Specific indices to apply the operation to.
Example Call
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" \
-d "query=smart&limit=3" \
https://telicent.core.domain/api/search/typeahead
Responses
Same as GET /typeahead
.