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

chore: add missing geo distance type on hits #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codingwithchris
Copy link

@codingwithchris codingwithchris commented Jul 18, 2022

Change Summary

Adding missing geo_distance_meters type in SearchResponseHit interface.

PR Checklist

Questions.

Is location truly optional in this instance? Could we hit a case where a geo_distance_meters parameter is returned but location doesn't exist or has an undefined value?

@codingwithchris codingwithchris changed the title chore: add optional geo distance type on hits chore: add missing geo distance type on hits Jul 18, 2022
Copy link
Member

@jasonbosco jasonbosco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the late response. The Github notification for this PR slipped through the cracks in my inbox.

@@ -70,6 +70,9 @@ export interface SearchResponseHit<T extends DocumentSchema> {
matched_tokens: string[];
}
];
geo_distance_meters?: {
location?: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

location is actually the name of the geopoint field from the document. So this needs to be a dynamic type which allows keys with the same name as any of the document's fields...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants