I'm currently implementing a search function on a website based on craft, and I was wondering if there was a way of actually showing a small snippet of text that shows in what context the search actually matched.

At the moment the result simply returns the corresponding {{entry.title}}, however I would like the result to also display something like [...] a chain of mountains with the highest *peak* being around x-thousand metres [...] when 'peak' was the search term.

Is there any way to achieve this within Craft? thanks

1 Answer 1


Yes, there is. There is a plugin called Weighted Search which I have used a few times which does exactly that. https://straightupcraft.com/craft-plugins/weighted-search

  • That's great, I'll have a look at it. Thanks Laura! Nov 23, 2016 at 14:55
  • No problem. Happy to help. Nov 23, 2016 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.