Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Jun 21, 2023
1 parent 6ee2e73 commit b3fbdd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.indices.SystemIndexDescriptor;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.aggregations.BucketOrder;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
Expand Down Expand Up @@ -289,10 +288,10 @@ private static IndexRequest createSynonymRuleIndexRequest(String synonymsSetId,
}
builder.endObject();

return new IndexRequest(SYNONYMS_ALIAS_NAME).id(internalSynonymRuleId(synonymsSetId, synonymRule))
return new IndexRequest(SYNONYMS_ALIAS_NAME).id(internalSynonymRuleId(synonymsSetId, synonymRule.id()))
.opType(DocWriteRequest.OpType.INDEX)
.source(builder)
.id(internalSynonymRuleId(synonymsSetId, synonymRule));
.id(internalSynonymRuleId(synonymsSetId, synonymRule.id()));
}
}

Expand Down Expand Up @@ -357,8 +356,7 @@ private <T> void reloadAnalyzers(ActionListener<SynonymsReloadResult<T>> listene

// Retrieves the internal synonym rule ID to store it in the index. As the same synonym rule ID
// can be used in different synonym sets, we prefix the ID with the synonym set to avoid collisions
private static String internalSynonymRuleId(String synonymsSetId, SynonymRule synonymRule) {
String synonymRuleId = synonymRule.id();
private static String internalSynonymRuleId(String synonymsSetId, String synonymRuleId) {
if (synonymRuleId == null) {
synonymRuleId = UUIDs.base64UUID();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ protected Writeable.Reader<GetSynonymRuleAction.Request> instanceReader() {

@Override
protected GetSynonymRuleAction.Request createTestInstance() {
return new GetSynonymRuleAction.Request(
randomIdentifier(),
randomIdentifier()
);
return new GetSynonymRuleAction.Request(randomIdentifier(), randomIdentifier());
}

@Override
Expand Down

0 comments on commit b3fbdd8

Please sign in to comment.