Skip to content

Commit

Permalink
Use the document fields only, excluding the metadata fields (#77203) (#…
Browse files Browse the repository at this point in the history
…77331)

(cherry picked from commit 44b8c96)
  • Loading branch information
astefan committed Sep 7, 2021
1 parent 8266aa5 commit fa60a09
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ setup:
index: eql_test
body:
mappings:
properties:
some_keyword:
type: keyword
ignore_above: 5 # see https://github.com/elastic/elasticsearch/issues/77152
runtime:
day_of_week:
type: keyword
Expand All @@ -23,6 +27,7 @@ setup:
user: SYSTEM
id: 123
valid: false
some_keyword: longer than normal
- index:
_index: eql_test
_id: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public EventPayload(SearchResponse response) {
List<SearchHit> hits = RuntimeUtils.searchHits(response);
values = new ArrayList<>(hits.size());
for (SearchHit hit : hits) {
values.add(new Event(qualifiedIndex(hit), hit.getId(), hit.getSourceRef(), hit.getFields()));
values.add(new Event(qualifiedIndex(hit), hit.getId(), hit.getSourceRef(), hit.getDocumentFields()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SequencePayload extends AbstractPayload {
List<SearchHit> hits = docs.get(i);
List<Event> events = new ArrayList<>(hits.size());
for (SearchHit hit : hits) {
events.add(new Event(qualifiedIndex(hit), hit.getId(), hit.getSourceRef(), hit.getFields()));
events.add(new Event(qualifiedIndex(hit), hit.getId(), hit.getSourceRef(), hit.getDocumentFields()));
}
values.add(new org.elasticsearch.xpack.eql.action.EqlSearchResponse.Sequence(s.key().asList(), events));
}
Expand Down

0 comments on commit fa60a09

Please sign in to comment.