• Resolved Chris

    (@rtwlabs)


    Right now Algolia auto-creates a snippet excerpt on the main search page based on the keyword entered.

    So each post will vary the excerpt snippet shown to better highlight the context of the keyword searched.

    Is it possible to change the snippet to just pull a custom excerpt added regardless of keyword or hook in say your meta description from an SEO plugin to show that instead?

    In theory, this seems possible. We would include the excerpt field or meta description into the index for reference and then pull that out on the instant search results page. I just don’t fully grasp how that instant search page collects its data and applies it to the page I think is the issue.

    Or am I wrong and it just wouldn’t be possible?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I believe you’re going to need to delve into customizing the instantsearch templates for this.

    https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Customize-your-search-page

    It’s kind of going to depend on what all is in the javascript data objects being returned as results, and what properties exist with what content.

    Do you have the website in question available to share so that we could see what’s being displayed thus far, that you’re trying to amend?

    Thread Starter Chris

    (@rtwlabs)

    Michael yes I believe editing that template is what is needed I just don’t understand the instant search process enough yet I think to know what JS objects I can reference to pull in the required fields in the algolia data set.

    Is there a crash course in how instantsearch and algolia talk to each other so I can work out how/what elements can be changed in that template file?

    I don’t have a version of the site I can share right now. But as a basic break down we stripped the instant search template back to just list blog posts in a list with thumbnail, title and the snippet/excerpt the default template was outputing.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Closest suggestion I have at the moment would be the Algolia documentation as a whole, and to certain degrees our wiki pages over at https://github.com/WebDevStudios/wp-search-with-algolia/wiki

    We haven’t strayed the plugin so far away that their official docs wouldn’t apply any more.

    Thread Starter Chris

    (@rtwlabs)

    Thanks, Michael. Will put some time aside to dig through there some. Appreciate your time.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adjust what excerpt gets displayed’ is closed to new replies.