Read more functionality added after Algolia InstantSearch has loaded


I’ve added a search to a site to search through FAQs. That all works fine, however I would like add a read more to expand the returned content. For example instead of having the whole faq content I’d like something along the lines of “This is an faq… read more”. I’ve added code for this which works fine if injected through the console but does not appear to have any affect if added within a script. No errors appear however.

I was wondering whether anyone had done something like this before and had any advice? I’m guessing it would seem that the Algolia stuff is loading after. I’ve tried wrapping my code around document ready tags and ensuring it comes after any of the Algolia code to no avail.

Thank you

If you’re using InstantSearch for your front end interface, it supports snippeting out of the box:

You could include the content as a snippet, with a link to the full content as part of your hit template.