-
Notifications
You must be signed in to change notification settings - Fork 48
Default size to 100 #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Default size to 100 #122
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,13 @@ def search_index(args: SearchIndexArgs) -> json: | |
| from .client import initialize_client | ||
|
|
||
| client = initialize_client(args) | ||
| response = client.search(index=args.index, body=args.query) | ||
|
|
||
| # Set default size to 100 if not present in query body | ||
| query = args.query.copy() if isinstance(args.query, dict) else args.query | ||
| if isinstance(query, dict) and 'size' in query: | ||
| query['size'] = min(100, query['size']) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would mean we would not be able to send a size > 100. I believe this kind of restriction is not ideal, can we make it configurable in settings?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like a similar PR has already been raised in #114
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should I close my pr if a similar PR has already been raised ? |
||
|
|
||
| response = client.search(index=args.index, body=query) | ||
| return response | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.