Table of Contents

Class SearchHighlightOptions<TDocument>

Namespace
MongoDB.Driver.Search
Assembly
MongoDB.Driver.dll

Options for highlighting.

public sealed class SearchHighlightOptions<TDocument>

Type Parameters

TDocument

The type of the document.

Inheritance
SearchHighlightOptions<TDocument>
Inherited Members

Constructors

SearchHighlightOptions(SearchPathDefinition<TDocument>, int?, int?)

Initializes a new instance of the SearchHighlightOptions<TDocument> class.

public SearchHighlightOptions(SearchPathDefinition<TDocument> path, int? maxCharsToExamine = null, int? maxNumPassages = null)

Parameters

path SearchPathDefinition<TDocument>

The document field to search.

maxCharsToExamine int?

maximum number of characters to examine.

maxNumPassages int?

The number of high-scoring passages.

SearchHighlightOptions(Expression<Func<TDocument, object>>, int?, int?)

Creates highlighting options.

public SearchHighlightOptions(Expression<Func<TDocument, object>> path, int? maxCharsToExamine = null, int? maxNumPassages = null)

Parameters

path Expression<Func<TDocument, object>>

The document field to search.

maxCharsToExamine int?

The maximum number of characters to examine on a document when performing highlighting for a field.

maxNumPassages int?

The number of high-scoring passages to return per document in the highlighting results for each field.

Properties

MaxCharsToExamine

Gets or sets the maximum number of characters to examine on a document when performing highlighting for a field.

public int? MaxCharsToExamine { get; set; }

Property Value

int?

MaxNumPassages

Gets or sets the number of high-scoring passages to return per document in the highlighting results for each field.

public int? MaxNumPassages { get; set; }

Property Value

int?

Path

Gets or sets the document field to search.

public SearchPathDefinition<TDocument> Path { get; set; }

Property Value

SearchPathDefinition<TDocument>

Methods

Render(SearchDefinitionRenderContext<TDocument>)

Renders the options to a BsonDocument.

public BsonDocument Render(SearchDefinitionRenderContext<TDocument> renderContext)

Parameters

renderContext SearchDefinitionRenderContext<TDocument>

The render context.

Returns

BsonDocument

A BsonDocument.