Added Index-Based Configurable Partial Search Result Setting #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces an index-based configurable setting for partial search results in Elasticsearch. The primary objective is to enable a boolean variable (
isPartialSearchAllowed
) at the index level, which dictates whether partial search results are allowed for queries involving multiple indices.Key Changes
1. New Index Metadata Field
partial_search_allowed
to the index metadata. This field is dynamically set based on a cluster-wide setting and can be updated independently for each index.2. Index Setting Update
indices.partial_search.total.use_index_based_setting
, to control the index-based partial search behavior.false
3. Index Metadata Builders
IndexMetadata.Builder
) to construct and update index metadata with thepartial_search_allowed
field.partial_search_allowed
setting.4. Python Automation Script
AutomatedIndexUpdateScript.py
) that periodically checks indices based on their creation date.partial_search_allowed
totrue
, utilizing Elasticsearch's Python client (elasticsearch-py
).5. Integration with Search Request Handling
TransportSearchAction.java
) to evaluate thepartial_search_allowed
flag for each index involved in a search request.partial_search_allowed
flags across indices in the search request.Configuration for Index-Based Partial Search Setting
To configure the
index.partial_search_allowed
setting for a specific index, use the following configuration in Kibana or through the Elasticsearch API:Enable Partial Search for a Specific Index
Replace
{index_name}
with the name of your index.