Skip to content

Commit

Permalink
Merge pull request SolrNet#192 from xaviermorera/patch-4
Browse files Browse the repository at this point in the history
Update Highlighting documentation
  • Loading branch information
mausch committed May 5, 2015
2 parents 0c425c0 + cc6ae59 commit b733d1d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Documentation/Highlighting.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Highlighting

This feature will "highlight" (typically with markup) the terms that matched the query, including a snippet of the text around the matched term.
This feature will "highlight" (typically with markup) the terms that matched the query, including a snippet of the text around the matched term.

To enable highlighting please include a HighlightingParameters QueryOptions object where you include which fields you want to apply highlighting to.

Sample code:

Expand All @@ -20,4 +22,12 @@ would print for example:
features: <em>Noise</em>Guard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor
```

The results object will include:
- A Highlights property which is an IDictionary<string, SolrNet.Impl.HighlightedSnippets>.
- The string corresponds to the document uniquekey
- The HighlightedSnippets is an IDictionary<string, ICollection<string>>. This object indicates which field is being returned, for example "features" and the snppet text "<em>Noise</em>Guard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor"


The returned tag corresponds to <em> although it can be configured directly in Solr to use a different tag. Also, if the request handler in Solr is configured to include highlights, it is not required to add the query options.

For more details about this feature, see the [Solr wiki](http://wiki.apache.org/solr/HighlightingParameters) and the [reference guide](https://cwiki.apache.org/confluence/display/solr/Highlighting).

0 comments on commit b733d1d

Please sign in to comment.