Improve search result sorting and add subtitles to results #212
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🐛 Issue
Since we have two indices, search results always return with web page results first, and content item results second.
This makes it hard to the user to understand which results to look at, and without any other result context (like summaries) the quality of the search results feel very poor.
✏️ Solution
Combine multi-index results into a single array. This is hacky, and isn't a permanent solution. Best case - the results end up in a much better order. Worse case - they end up in a similar order to they are already.
Add summary/subtitles to results
Remove "Search history" section if you have search results
As a follow up, @vinnyjth is going to document work to be done on the shovel to create a new, combined index that we can start tweaking to more dramatically improve search results.
Also, we will need to pursue a minor (hopefully) refactor for search on the web. Currently, all search is done through the autocomplete API on Algolia, not the instantsearch api. This means that features like snippeting is not available, and we also can not use any of Algolia's out of the box react components. Not using algolia best practices, unfortunately.
🔬 To Test
📸 Screenshots