opensearch-project / opensearch-project/OpenSearch
Add settings to enable/disable different types of expensive queries independently
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 13.7k
- Forks
- 3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 108
Description
Is your feature request related to a problem? Please describe.
The granularity of the setting allow_expensive_queries is a bit coarse.
This setting enables/disables ALL the following query types:
- Queries that need to do linear scans to identify matches
- script queries
- Queries that have a high up-front cost
- fuzzy queries (except on wildcard fields)
- regexp queries (except on wildcard fields)
- prefix queries (except on wildcard fields or those without index_prefixes)
- wildcard queries (except on wildcard fields)
- range queries on text and keyword fields
- Joining queries
- Queries on deprecated geo shapes
- Queries that may have a high per-document cost:
- script score queries
- percolate queries
Describe the solution you'd like
I would like there to be settings for each type and have the allow_expensive_queries override them all on true for backward compatibility (default is true).
Describe alternatives you've considered
preventing certain query types in an external service outside the cluster.
Additional context
Some exceptions to the allow_expensive_queries should be made so we can enjoy the benefits of different query types while remaining protected from other expensive types.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation files or tests are named. Start by tracing the existing allow_expensive_queries setting and the listed query types, then define how independent settings interact with the backward-compatible override. Done means each requested query category can be controlled independently while the existing default behavior remains compatible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100