Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Automatically Switch Default Query Operator to OR for Low Hit Count Searches #2832

Closed
marevol opened this issue Jul 22, 2024 · 0 comments
Closed
Assignees
Milestone

Comments

@marevol
Copy link
Contributor

marevol commented Jul 22, 2024

We have implemented a new feature where the search functionality automatically switches the default query operator from AND to OR when the hit count is below a specified threshold (query.orsearch.min.hit.count). This ensures that users receive more comprehensive search results when their initial query returns too few results.

Implementation Details:

  • Added a constant DEFAULT_QUERY_OPERATOR in Constants.java.
  • Updated SearchHelper.java to re-execute the search with OR operator if the initial hit count is below query.orsearch.min.hit.count.
  • Introduced configuration keys QUERY_ORSEARCH_MIN_HIT_COUNT and related methods in FessConfig.java.
  • Modified QueryParser.java to set the default operator based on the request attribute DEFAULT_QUERY_OPERATOR.
@marevol marevol added this to the 14.16.0 milestone Jul 22, 2024
@marevol marevol self-assigned this Jul 22, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant