diff --git a/src/python/txtai/api/base.py b/src/python/txtai/api/base.py index df004e7bd..404dae47b 100644 --- a/src/python/txtai/api/base.py +++ b/src/python/txtai/api/base.py @@ -23,7 +23,7 @@ def __init__(self, config, loaddata=True): self.cluster = Cluster(self.config["cluster"]) # pylint: disable=W0221 - def search(self, query, request=None, limit=None): + def search(self, query, limit=None, request=None): # When search is invoked via the API, limit is set from the request # When search is invoked directly, limit is set using the method parameter limit = self.limit(request.query_params.get("limit") if request and hasattr(request, "query_params") else limit) diff --git a/src/python/txtai/api/routers/embeddings.py b/src/python/txtai/api/routers/embeddings.py index 84295daa4..c40608e66 100644 --- a/src/python/txtai/api/routers/embeddings.py +++ b/src/python/txtai/api/routers/embeddings.py @@ -27,7 +27,7 @@ def search(query: str, request: Request): list of {id: value, score: value} """ - return application.get().search(query, request) + return application.get().search(query, request=request) @router.post("/batchsearch")