Skip to content

enhance: increase default search results from 5 to 50 - #17

Merged
qowlgur121 merged 1 commit into
developfrom
feature/increase-search-results-limit
Aug 18, 2025
Merged

enhance: increase default search results from 5 to 50#17
qowlgur121 merged 1 commit into
developfrom
feature/increase-search-results-limit

Conversation

@qowlgur121

Copy link
Copy Markdown
Member

Summary

This PR enhances the user experience of the MCP search functionality by increasing the default number of search results from 5 to 50. This change provides users with more comprehensive search coverage without requiring manual parameter adjustment.

Key Changes

  • SearchController: Updated topK default parameter from 5 to 50
  • DocsSearchController: Updated Swagger documentation to reflect new default value
  • API Documentation: Enhanced operation description to clarify the new default behavior

Rationale

The previous default of 5 results was too restrictive for effective exploratory search. Users often need to see a broader range of potentially
relevant content before selecting specific chunks for detailed review. The new default of 50 results:

  • Better serves the exploratory search use case (find_knowledge MCP tool)
  • Reduces the need for users to manually adjust topK parameters
  • Maintains backward compatibility for clients that specify explicit topK values
  • Aligns with typical search result expectations in knowledge discovery workflows

Technical Details

  • Backward Compatibility: Fully maintained - existing clients can still specify custom topK values
  • Performance Impact: Minimal - search performance scales well with result count
  • API Changes: Only default values changed, no breaking changes to API signatures

Testing Instructions

  1. Navigate to /swagger-ui.html and test the search endpoint
  2. Verify that searches without topK parameter now return up to 50 results by default
  3. Confirm that explicit topK parameters still work as expected
  4. Test with both small and large result sets to ensure performance remains acceptable

Files Modified

  • SearchController.java - Updated default topK parameter
  • DocsSearchController.java - Updated Swagger documentation and parameter descriptions

Related Features

  • Improves MCP find_knowledge tool effectiveness
  • Enhances user experience for knowledge discovery workflows
  • Supports more comprehensive search result evaluation

Improve user experience by providing more comprehensive search results
by default. The MCP find_knowledge tool now returns up to 50 relevant
chunks instead of only 5, giving users better coverage of available
knowledge without requiring manual parameter adjustment.

This change better serves the exploratory search use case where users
want to see a broader set of potentially relevant content before
selecting specific chunks for detailed review.

Updated both the implementation and API documentation to reflect
the new default behavior while maintaining backward compatibility
for clients that explicitly specify topK values.
@qowlgur121
qowlgur121 merged commit bb1602a into develop Aug 18, 2025
@Yoo-SH Yoo-SH mentioned this pull request Aug 21, 2025
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant