Skip to content

Commit 14582f9

Browse files
committed
set ignore_unavailable to undefined
1 parent 4c09af6 commit 14582f9

File tree

1 file changed

+7
-3
lines changed
  • x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv

1 file changed

+7
-3
lines changed

x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
cellHasFormulas,
1717
ISearchSource,
1818
ISearchStartSearchSource,
19+
ES_SEARCH_STRATEGY,
1920
SearchFieldValue,
2021
SearchSourceFields,
2122
tabifyDocs,
@@ -98,10 +99,14 @@ export class CsvGenerator {
9899
},
99100
size: scrollSettings.size,
100101
ignore_throttled: !includeFrozen,
102+
ignore_unavailable: undefined,
101103
};
102104

103-
const results = (await this.clients.es.asCurrentUser.search(searchParams))
104-
.body as estypes.SearchResponse<unknown>;
105+
const results = (
106+
await this.clients.data
107+
.search({ params: searchParams }, { strategy: ES_SEARCH_STRATEGY })
108+
.toPromise()
109+
).rawResponse as estypes.SearchResponse<unknown>;
105110

106111
return results;
107112
}
@@ -324,7 +329,6 @@ export class CsvGenerator {
324329
).body.id;
325330
}
326331

327-
// use the scroll cursor in Elasticsearch
328332
const results = await this.scroll(pitId, settings, searchSource, searchAfter);
329333
if (results.hits?.total != null && !totalRecords) {
330334
totalRecords =

0 commit comments

Comments
 (0)