OpenSearch-Dashboards
OpenSearch-Dashboards copied to clipboard
[BUG] Type errors in sort in `OpenSearchHitRecord`
Describe the bug
In src/plugins/discover/public/application/components/doc_views/context/api/anchor.ts, fetchAnchor function returns the following
return {
...doc,
isAnchor: true,
} as OpenSearchHitRecord;
It has type error Types of property 'sort' are incompatible.Type 'string[] | undefined' is not comparable to type 'number[]'. because OpenSearchHitRecord set the sort to be number[] type but sort is returned as a string[] type.
export interface OpenSearchHitRecord {
fields: Record<string, any>;
sort: number[];
_source: Record<string, any>;
_id: string;
isAnchor?: boolean;
}
Why is sort being defined as number[] in OpenSearchHitRecord? Is this an error?