<p>Yes, there is. There is a plugin called Weighted Search which I have used a few times which does exactly that. <a href="https://straightupcraft.com/craft-plugins/weighted-search" rel="nofollow noreferrer">https://straightupcraft.com/craft-plugins/weighted-search</a></p>

CC BY-SA 3.0
2016-11-23T14:55:26.230Z
That's great, I'll have a look at it. Thanks Laura!
justussimon91
CC BY-SA 3.0
2016-11-23T15:22:02.383Z
No problem. Happy to help.
Laura Montgomery
CC BY-SA 3.0
2016-11-23T14:54:39.423Z
2016-11-23T14:54:39.423Z
Laura Montgomery
<p>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.</p>

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

<p>Is there any way to achieve this within Craft?
thanks</p>

<search>
Show context of match in search result
# Show context of match in search result

(Asked by: username_0 on 2016-11-23)

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

**Tags:** search

---

## 1 answers

### Answer by username_1 on 2016-11-23. Score: 2 | Accepted answer

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>

> **Comments:**
> **username_0**: That's great, I'll have a look at it. Thanks Laura!  
> **username_1**: No problem. Happy to help.  

---

