-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Synonyms API - Add refresh parameter to check synonyms index and reload analyzers #126935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Synonyms API - Add refresh parameter to check synonyms index and reload analyzers #126935
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
…chable-refresh' into bugfix/synonyms-index-searchable-refresh
ENTRY_PARSER.declareStringArray(constructorArg(), ReloadAnalyzersResponse.RELOADED_NODE_IDS_FIELD); | ||
ENTRY_PARSER.declareStringArray(constructorArg(), ReloadAnalyzersResponse.RELOADED_ANALYZERS_FIELD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a bug in the parsing method in the tests for ReloadAnalyzerResponseTests 🤯
|
||
public class SynonymUpdateResponseSerializingTests extends AbstractWireSerializingTestCase<SynonymUpdateResponse> { | ||
public class SynonymUpdateResponseSerializingTests extends AbstractBWCSerializationTestCase<SynonymUpdateResponse> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding BWC serialization compat testing
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @carlosdelest, I've created a changelog YAML for you. |
…-searchable-refresh # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
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
refresh
parameter to the following APIs:When
refresh
is true, after updating the synonyms system index, the following operations will be executed:refresh
is true by default to maintain the previous behaviour. Whenrefresh
is true, reload analyzers information will be included in the response.