mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Elasticsearch: View in context feature for logs (#28764)
* Elasticsearch: View in context feature for logs * Fixing unused type * Limit show context to esVersion > 5 * Fixing scope for showContextToggle; removing console.log * Fix typing; adding check for lineField * Update test to reflect new sorting keys for logs * Removing sort from metadata fields * Adding comment for clarity * Fixing scenerio where the data is missing * remove export & use optional chaining Co-authored-by: Elfo404 <gio.ricci@grafana.com>
This commit is contained in:
@@ -372,6 +372,7 @@ export class ElasticResponse {
|
||||
_id: hit._id,
|
||||
_type: hit._type,
|
||||
_index: hit._index,
|
||||
sort: hit.sort,
|
||||
};
|
||||
|
||||
if (hit._source) {
|
||||
@@ -552,6 +553,7 @@ type Doc = {
|
||||
_type: string;
|
||||
_index: string;
|
||||
_source?: any;
|
||||
sort?: Array<string | number>;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -572,6 +574,7 @@ const flattenHits = (hits: Doc[]): { docs: Array<Record<string, any>>; propNames
|
||||
_id: hit._id,
|
||||
_type: hit._type,
|
||||
_index: hit._index,
|
||||
sort: hit.sort,
|
||||
_source: { ...flattened },
|
||||
...flattened,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user