SharePoint custom search results to show number of occurrences in a document

Brass Contributor

Good day!

 

Is there a way to show the number of occurrences of a search term next to each document displayed as a result of the search?

 

Additionally, could I group each occurrence (with surrounding text) of that search term in the document?

 

What I'm looking to achieve is something like this:

 

Search term: "contoso"


-----------------------------------------------------------------------------------------------------------------


Document1.docx (3 occurrences)

1) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquam vitae sapien non mattis. Vestibulum eget maximus odio. Contoso lacinia tortor sed risus fermentum cursus. Morbi eu tincidunt velit. 

2) Curabitur semper ex eu contoso, vitae auctor elit molestie.

 

3) Contoso dolor sit amet, consectetur adipiscing elit. Curabitur accumsan sapien at pellentesque
ultricies. Nullam maximus purus eget tortor aliquam dictum.


-----------------------------------------------------------------------------------------------------------------

Document2.pdf (1 occurrence)
1) Morbi vel egestas turpis, sit amet rutrum neque. Phasellus vel erat at magna molestie convallis vel ornare odio. Mauris eros contoso, tincidunt in ante eget, rutrum egestas lorem.

-----------------------------------------------------------------------------------------------------------------

Some directions on how to make this work would be excellent, but what I really want to know for now is if this template is possible to be implemented at all.

1 Reply