Elasticsearch: Add word highlighting to search results (#30293)

* Elasticsearch: Add word highlighting to logs

* Remove unused deps; refactor matching code to remove matchAll

* Adding searchWords test

* Adding two matches for highlighting

* Adding code comments

* formatting comments
This commit is contained in:
Chris Cowan
2021-02-24 09:31:17 -07:00
committed by GitHub
parent c8deaeacce
commit 65b1e536d7
4 changed files with 70 additions and 6 deletions

View File

@@ -26,6 +26,11 @@ export const movingAvgModelOptions: MovingAverageModelOption[] = [
{ label: 'Holt Winters', value: 'holt_winters' },
];
export const highlightTags = {
pre: '@HIGHLIGHT@',
post: '@/HIGHLIGHT@',
};
export function defaultMetricAgg(id = '1'): MetricAggregation {
return { type: 'count', id };
}