algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.61k stars 505 forks source link

Content injection between Hits for InstantSearch.js #4999

Open dhayab opened 2 years ago

dhayab commented 2 years ago

We recently published a guide on how to inject custom content between hits, for React InstantSearch, and we'd like to gather interest in adapting this guide for InstantSearch.js.

What's Content injection between Hits?

Content injection consists of inserting data between search results. This pattern can be helpful for a variety of use cases:

image

See Live Demo →

How to show your interest?

Simply add a "👍" reaction on this issue, and optionally subscribe to its notifications. We will share updates here.

jonathan-bird commented 2 years ago

Very keen for this to be implemented in the Vue version as well as the React library.

mlbrgl commented 2 years ago

Also keen to see the React InstantSearch Hooks version.

JessycaFrederick commented 2 years ago

I'd love to see this instantsearch.js please!

unclescooby commented 1 year ago

Yes please add this for instantsearch.js

simonkoehler commented 1 year ago

+1 from me 👍

yannlugus commented 1 year ago

+1

robinsimonklein commented 1 year ago

+1 !

emregozel commented 1 year ago

We need this function on the product category page to show some banner or content between two products.

Haroenv commented 1 year ago

While this isn't yet planned, I'm on support today so I have made a demo on content injection in InstantSearch.js, you can see that here: https://github.com/algolia/doc-code-samples/pull/412

davpetersonaz commented 5 months ago

really want this feature in instantsearch.js, we currently have tiles injected between search results which i added to my code a couple years ago, and we thought it would be available for the algolia JS version...

kelenakamura commented 2 months ago

looks like this was added to v6 of react instant search, but not avail in v7. how come?

Haroenv commented 2 months ago

The most impactful a comment can be is explaining which subset of the features would be interesting to you; are the injected content static banners, set by rules, coming from another index, how do you want to decide where it goes etc.

kelenakamura commented 2 months ago

i got here from this page - https://www.algolia.com/doc/deprecated/instantsearch/react/v6/guides/injecting-content/ - so im voting on having that avail in V7.

i think being able to insert hits from another index like the recipes and ingredients example would be ideal. though from 3rd party sources would be great too (ie cms - for promotions etc).

if we want this functionality now, does that mean we just have to stick with v6?

Haroenv commented 2 months ago

@kelenakamura https://github.com/algolia/instantsearch/issues/5440 would be the right issue for react. Multiple indices I'd recommend using useInstantSearch to read scopedResults (combined with multiple index widgets) and doing the merge in user land

kelenakamura commented 2 months ago

@Haroenv oh perfect ill subscribe to that one thanks!

Also if you combine in user land, then you'll need to manually manage pagination numbers so that you return 1 less for each page of results you want to insert content into? just so the total # of hits per page remains consistent.

emoltd commented 6 hours ago

Yes please add this for instantsearch.js