fix: use .keyword suffix for MDC exchangeId term query
Dynamically mapped string fields in OpenSearch are multi-field (text + keyword). Term queries require the .keyword sub-field for exact matching. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -113,7 +113,7 @@ public class OpenSearchLogIndex {
|
|||||||
// 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").value(FieldValue.of(exchangeId)))))
|
||||||
.should(Query.of(s -> s.term(t -> t.field("mdc.camel.exchangeId").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"))));
|
||||||
}
|
}
|
||||||
if (level != null && !level.isEmpty()) {
|
if (level != null && !level.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user