Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width50%
Panel
titleBGColor#B0C4DE
titleContents Summary
Table of Contents
stylenone
outlinetrue
typelist
Column
 
Info

The code in below examples uses some methods defined in Common Utilities.

Exact Phrase Search

Info

This feature is supported by version 16.10 or greater.

GroupDocs.Search allows you to search the documents by exact phrase.

The Recipe

To perform an exact phrase search, the following steps are needed to be followed:

  • Initialize Index
  • Add documents folder to Index
  • Perform a search operation using Index.search("\"exact phrase\"")

The Code

HTML
<script src="https://gist.github.com/GroupDocsGists/d7ab1aedacc6a70e4bf832fe2cfb752a.js"></script>
Note

Use double quotes in the query string for Exact Phrase Search.

Exact Phrase Search with Highlighted Results

Info

This feature is supported by version 17.2 or greater.

GroupDocs.Search allows you to generate HTML-formatted text with highlighted found terms for the results of exact phrase search. 

The Recipe

To save highlighted results, the following steps are needed to be followed:

  • Initialize Index
  • Add documents folder to Index
  • Perform a search operation using Index.search("\"exact phrase\"")

  • Save highlighted results using Index.HighlightInText()

The Code

HTML
<script src="https://gist.github.com/GroupDocsGists/455f1c1ca326f4606f8a9b6c69c5c883.js"></script>