Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Type errors in sort in OpenSearchHitRecord #7070

Open
abbyhu2000 opened this issue Jun 20, 2024 · 0 comments
Open

[BUG] Type errors in sort in OpenSearchHitRecord #7070

abbyhu2000 opened this issue Jun 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working discover for discover reinvent

Comments

@abbyhu2000
Copy link
Member

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?
Screenshot 2024-06-19 at 5 18 24 PM

@abbyhu2000 abbyhu2000 added bug Something isn't working untriaged labels Jun 20, 2024
@kavilla kavilla added discover for discover reinvent and removed untriaged labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discover for discover reinvent
Projects
None yet
Development

No branches or pull requests

3 participants