-
Notifications
You must be signed in to change notification settings - Fork 222
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
feat(types): introduce generic Hit
type
#1191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, but I think you used it in too many places, getObject(s) & browse don't have highlighting
17bf1a0
to
82d6f8e
Compare
|
||
export type MultipleQueriesResponse<TObject> = { | ||
/** | ||
* The list of results. | ||
*/ | ||
results: Array<SearchResponse<TObject & ObjectWithObjectID>>; | ||
results: Array<SearchResponse<TObject>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used it pass ObjectWithObjectID
here but it was already taken care of in SearchResponse
, so we had it passed twice. This was not an issue since this type is just adding objectID
another time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks very good!
In the future I'd love to play with attributesToRetrieve
& attributesToHighlight
deciding which keys get responded, although I'm not sure if you can get all of that statically (since it could be a setting)
This introduces a new generic
Hit
type that infers values for records' highlighting and snippeting results.