Skip to content

feat(types): introduce generic Hit type#1191

Merged
francoischalifour merged 4 commits intomasterfrom
feat/Hit-type
Sep 8, 2020
Merged

feat(types): introduce generic Hit type#1191
francoischalifour merged 4 commits intomasterfrom
feat/Hit-type

Conversation

@francoischalifour
Copy link
Copy Markdown
Contributor

@francoischalifour francoischalifour commented Sep 8, 2020

This introduces a new generic Hit type that infers values for records' highlighting and snippeting results.

@francoischalifour francoischalifour requested review from a team and Haroenv September 8, 2020 15:24
@ghost ghost requested review from yannickcr and removed request for a team September 8, 2020 15:24
Copy link
Copy Markdown
Contributor

@Haroenv Haroenv left a 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

* The list of results.
*/
results: Array<SearchResponse<TObject & ObjectWithObjectID>>;
results: Array<SearchResponse<TObject>>;
Copy link
Copy Markdown
Contributor Author

@francoischalifour francoischalifour Sep 8, 2020

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.

Copy link
Copy Markdown
Contributor

@Haroenv Haroenv left a 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)

@francoischalifour francoischalifour merged commit 919d3ab into master Sep 8, 2020
@francoischalifour francoischalifour deleted the feat/Hit-type branch September 8, 2020 16:20
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