Click or drag to resize

SearchDefinitionBuilderTDocumentRegexTField Method (ExpressionFuncTDocument, TField, SearchQueryDefinition, Boolean, SearchScoreDefinitionTDocument)

Creates a search definition that interprets the query as a regular expression.

Namespace:  MongoDB.Driver.Search
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.21.0+5a9c3311e158910b88195f290e6d4b1b2715d2b2
Syntax
public SearchDefinition<TDocument> Regex<TField>(
	Expression<Func<TDocument, TField>> path,
	SearchQueryDefinition query,
	bool allowAnalyzedField = false,
	SearchScoreDefinition<TDocument> score = null
)

Parameters

path
Type: System.Linq.ExpressionsExpressionFuncTDocument, TField
The indexed field or fields to search.
query
Type: MongoDB.Driver.SearchSearchQueryDefinition
The string or strings to search for.
allowAnalyzedField (Optional)
Type: SystemBoolean
Must be set to true if the query is run against an analyzed field.
score (Optional)
Type: MongoDB.Driver.SearchSearchScoreDefinitionTDocument
The score modifier.

Type Parameters

TField
The type of the field.

Return Value

Type: SearchDefinitionTDocument
A regular expression search definition.
See Also