Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-23T14:55:26.230Z
Answers.Text: That's great, I'll have a look at it. Thanks Laura!
Answers.UserDisplayName: justussimon91
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-23T15:22:02.383Z
Answers.Text: No problem. Happy to help.
Answers.UserDisplayName: Laura Montgomery
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-23T14:54:39.423Z
Answers.LastActivityDate: 2016-11-23T14:54:39.423Z
Answers.UserDisplayName: Laura Montgomery
Body: <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>
  
Tags: <search>
Title: Show context of match in search result
ThreadText: # 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 username_1!  
  > **username_1**: No problem. Happy to help.  
  
  ---
  
  