API

API Module

app.api.get_document(identifier: str, index_id: Annotated[str | None, Query(PydanticUndefined)] = None)[source]

Fetch a document from Elasticsearch with specific ID.

app.api.healthcheck()[source]

API endpoint to check the health of the application

It uses app.health.

A demo page to test the search endpoint directly

app.api.off_demo()[source]

Redirects to the off.html page

app.api.search(response: Response, search_parameters: Annotated[PostSearchParameters, Body(PydanticUndefined)])[source]

This is the main search endpoint.

It uses POST request to ensure privacy.

Under the hood, it calls the app.search.search() function

app.api.search_get(response: Response, search_parameters: Annotated[GetSearchParameters, Query(PydanticUndefined)]) ErrorSearchResponse | SuccessSearchResponse[source]

This is the main search endpoint when using GET request

Under the hood, it calls the app.search.search() function

app.api.taxonomy_autocomplete(q: Annotated[str, Query(PydanticUndefined)], taxonomy_names: Annotated[str, Query(PydanticUndefined)], lang: Annotated[str, Query(PydanticUndefined)] = 'en', size: Annotated[int, Query(PydanticUndefined)] = 10, fuzziness: Annotated[int | None, Query(PydanticUndefined)] = None, index_id: Annotated[str | None, Query(PydanticUndefined)] = None)[source]

API endpoint for autocompletion using taxonomies