Skip to content

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

@marevol

Description

@marevol

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions