Synonyms API - Add refresh parameter to check synonyms index and reload analyzers#126935
Merged
carlosdelest merged 42 commits intoelastic:mainfrom Apr 22, 2025
Merged
Conversation
…chable' into bugfix/synonyms-index-searchable
…-searchable-refresh # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
…chable-refresh' into bugfix/synonyms-index-searchable-refresh
This reverts commit 9c8e0b6.
…chable-refresh' into bugfix/synonyms-index-searchable-refresh
carlosdelest
commented
Apr 16, 2025
| ENTRY_PARSER.declareString(constructorArg(), ReloadAnalyzersResponse.INDEX_FIELD); | ||
| ENTRY_PARSER.declareStringArray(constructorArg(), ReloadAnalyzersResponse.RELOADED_ANALYZERS_FIELD); | ||
| ENTRY_PARSER.declareStringArray(constructorArg(), ReloadAnalyzersResponse.RELOADED_NODE_IDS_FIELD); | ||
| ENTRY_PARSER.declareStringArray(constructorArg(), ReloadAnalyzersResponse.RELOADED_ANALYZERS_FIELD); |
Member
Author
There was a problem hiding this comment.
There was a bug in the parsing method in the tests for ReloadAnalyzerResponseTests 🤯
| import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; | ||
|
|
||
| public class SynonymUpdateResponseSerializingTests extends AbstractWireSerializingTestCase<SynonymUpdateResponse> { | ||
| public class SynonymUpdateResponseSerializingTests extends AbstractBWCSerializationTestCase<SynonymUpdateResponse> { |
Member
Author
There was a problem hiding this comment.
Adding BWC serialization compat testing
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Collaborator
|
Hi @carlosdelest, I've created a changelog YAML for you. |
…-searchable-refresh # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
This was referenced Apr 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #121441
Synonyms APIs use a system index to store synonyms as individual documents. These documents need to be searched in order to be retrieved from the analyzers.
When the system index has not been created yet, it is possible that creating the index need some time for the replicas to be available for search. Thus, an analyzer that is reloaded after the synonyms are created won't be able to retrieve the synonyms, and as a consequence we won't have synonyms for the index until a reload analyzer operation is performed.
This PR fixes this issue by adding a
refreshparameter to the following APIs:When
refreshis true, after updating the synonyms system index, the following operations will be executed:refreshis true by default to maintain the previous behaviour. Whenrefreshis true, reload analyzers information will be included in the response.