Performs a global search across multiple entity types in the library using Elasticsearch. Returns search results grouped by entity type with pagination support.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Search across multiple entity types
This endpoint provides a unified search interface that searches across multiple entity types in your library using Elasticsearch. You can search for ingredients, recipes, images, albums, menus, recipe albums, purchase orders, stock items, supplier packages, and invoices all in a single request.
Search Query
The q parameter is required for the search to return results. If not provided, the endpoint will return empty results for all entity types.
Entity Type Filtering
Use the entity_types parameter to limit your search to specific entity types. Provide a comma-separated list of valid entity types:
ingredients- Search ingredientsrecipes- Search recipesimages- Search imagesalbums- Search image albumsmenus- Search menusrecipe_albums- Search recipe albumspurchase_orders- Search purchase ordersstock_items- Search stock itemssupplier_packages- Search supplier packagesinvoices- Search invoices
If entity_types is not provided, the search will include all available entity types.
Pagination
Results are paginated using the page and page_size parameters:
page: Page number starting at 1 (default: 1)page_size: Number of results per page, maximum 200 (default: 15)
Response Structure
The response is organized by entity type, with each type containing:
items: Array of matching items with relevant attributescount: Number of matching items found
Each item includes a pk (primary key) and a detail_url when available, which can be used to fetch full details of the item.
Search Behavior
The search uses Elasticsearch's full-text search capabilities with n-gram analysis, allowing for flexible matching:
- Prefix matching (e.g., "chick" matches "chicken")
- Infix matching (e.g., "ken" matches "chicken")
- Exact matching for precise queries
Results are sorted by relevance score, with the most relevant matches appearing first.
