Skip to content

Commit

Permalink
Update parameter order in API.search
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmezzetti committed Feb 6, 2023
1 parent a40ccdf commit e288b7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/python/txtai/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/python/txtai/api/routers/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit e288b7b

Please sign in to comment.