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
.
- app.api.html_search(request: Request, q: str | None = None, page: int = 1, page_size: int = 24, langs: str = 'fr,en', sort_by: str | None = None, index_id: Annotated[str | None, Query(PydanticUndefined)] = None, display_debug: bool = False)[source]¶
A demo page to test the search endpoint directly
- 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