Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/opensearch/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Copy link
Collaborator

@rithin-pullela-aws rithin-pullela-aws Nov 7, 2025

Choose a reason for hiding this comment

The 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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a similar PR has already been raised in #114

Copy link
Author

Choose a reason for hiding this comment

The 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


Expand Down
Loading