mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
🌊 Streams: Speed up sampling (#207334)
The sampling API can easily get slow because it matches on runtime fields. This PR picks the low hanging fruits in speeding it up: * Not tracking the total hits because that would require to scan all documents (by default it goes up to 10k) * Stopping the search after as many matches as requested were found This is not sufficient as search can still be very slow if condition matches are rare, as millions of docs might have to be scanned. This can be improved further in follow-up PRs.
This commit is contained in:
parent
1e5abbe8ee
commit
49b28eda65
1 changed files with 2 additions and 0 deletions
|
@ -187,6 +187,8 @@ export const sampleStreamRoute = createServerRoute({
|
|||
},
|
||||
},
|
||||
],
|
||||
terminate_after: size,
|
||||
track_total_hits: false,
|
||||
size,
|
||||
};
|
||||
const results = await scopedClusterClient.asCurrentUser.search({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue