fix: use .keyword suffix on both exchangeId term queries
Defensive: use .keyword on the top-level exchangeId field too, in case indices were created before the explicit keyword mapping was added to the template. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -112,7 +112,7 @@ public class OpenSearchLogIndex {
|
|||||||
if (exchangeId != null && !exchangeId.isEmpty()) {
|
if (exchangeId != null && !exchangeId.isEmpty()) {
|
||||||
// Match on top-level field (new records) or MDC nested field (old records)
|
// Match on top-level field (new records) or MDC nested field (old records)
|
||||||
bool.must(Query.of(q -> q.bool(b -> b
|
bool.must(Query.of(q -> q.bool(b -> b
|
||||||
.should(Query.of(s -> s.term(t -> t.field("exchangeId").value(FieldValue.of(exchangeId)))))
|
.should(Query.of(s -> s.term(t -> t.field("exchangeId.keyword").value(FieldValue.of(exchangeId)))))
|
||||||
.should(Query.of(s -> s.term(t -> t.field("mdc.camel.exchangeId.keyword").value(FieldValue.of(exchangeId)))))
|
.should(Query.of(s -> s.term(t -> t.field("mdc.camel.exchangeId.keyword").value(FieldValue.of(exchangeId)))))
|
||||||
.minimumShouldMatch("1"))));
|
.minimumShouldMatch("1"))));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user