Table of Contents

Class SearchDefinitionBuilder<TDocument>

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

A builder for a search definition.

public sealed class SearchDefinitionBuilder<TDocument>

Type Parameters

TDocument

The type of the document.

Inheritance
SearchDefinitionBuilder<TDocument>
Inherited Members

Methods

Autocomplete(SearchPathDefinition<TDocument>, SearchQueryDefinition, SearchAutocompleteTokenOrder, SearchFuzzyOptions, SearchScoreDefinition<TDocument>)

Creates a search definition that performs a search for a word or phrase that contains a sequence of characters from an incomplete input string.

Autocomplete<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, SearchAutocompleteTokenOrder, SearchFuzzyOptions, SearchScoreDefinition<TDocument>)

Creates a search definition that performs a search for a word or phrase that contains a sequence of characters from an incomplete search string.

Compound(SearchScoreDefinition<TDocument>)

Creates a builder for a compound search definition.

EmbeddedDocument<TField>(FieldDefinition<TDocument, IEnumerable<TField>>, SearchDefinition<TField>, SearchScoreDefinition<TDocument>)

Creates a search definition that performs a search for documents where the specified query operator is satisfied from a single element of an array of embedded documents specified by path.

EmbeddedDocument<TField>(Expression<Func<TDocument, IEnumerable<TField>>>, SearchDefinition<TField>, SearchScoreDefinition<TDocument>)

Creates a search definition that performs a search for documents where the specified query operator is satisfied from a single element of an array of embedded documents specified by path.

Equals<TField>(FieldDefinition<TDocument, TField>, TField, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for documents where an indexed field is equal to the specified value. Supported value types are null, boolean, numeric, ObjectId, Guid, date and string.

Equals<TField>(Expression<Func<TDocument, IEnumerable<TField>>>, TField, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for documents where at least one element in an indexed array field is equal to the specified value. Supported value types are boolean, numeric, ObjectId, date and string.

Equals<TField>(Expression<Func<TDocument, TField>>, TField, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for documents where an indexed field is equal to the specified value. Supported value types are null, boolean, numeric, ObjectId, Guid, date and string.

Exists(FieldDefinition<TDocument>)

Creates a search definition that tests if a path to a specified indexed field name exists in a document.

Exists<TField>(Expression<Func<TDocument, TField>>)

Creates a search definition that tests if a path to a specified indexed field name exists in a document.

Facet(SearchDefinition<TDocument>, params SearchFacet<TDocument>[])

Creates a search definition that groups results by values or ranges in the specified faceted fields and returns the count for each of those groups.

Facet(SearchDefinition<TDocument>, IEnumerable<SearchFacet<TDocument>>)

Creates a search definition that groups results by values or ranges in the specified faceted fields and returns the count for each of those groups.

GeoShape<TCoordinates>(SearchPathDefinition<TDocument>, GeoShapeRelation, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for shapes with a given geometry.

GeoShape<TCoordinates, TField>(Expression<Func<TDocument, TField>>, GeoShapeRelation, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for shapes with a given geometry.

GeoWithin<TCoordinates>(SearchPathDefinition<TDocument>, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for geographic points within a given geometry.

GeoWithin<TCoordinates>(SearchPathDefinition<TDocument>, GeoWithinArea<TCoordinates>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for geographic points within a given geo object.

GeoWithin<TCoordinates, TField>(Expression<Func<TDocument, TField>>, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for geographic points within a given geometry.

GeoWithin<TCoordinates, TField>(Expression<Func<TDocument, TField>>, GeoWithinArea<TCoordinates>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for geographic points within a given geo object.

In<TField>(SearchPathDefinition<TDocument>, IEnumerable<TField>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for documents where the value of the field equals to any of specified values.

In<TField>(Expression<Func<TDocument, TField>>, IEnumerable<TField>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for documents where the value of the field equals to any of specified values.

MoreLikeThis<TLike>(IEnumerable<TLike>)

Creates a search definition that returns documents similar to the input documents.

MoreLikeThis<TLike>(params TLike[])

Creates a search definition that returns documents similar to the input documents.

Near(SearchPathDefinition<TDocument>, DateTime, long, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near(SearchPathDefinition<TDocument>, double, double, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near(SearchPathDefinition<TDocument>, int, int, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near(SearchPathDefinition<TDocument>, long, long, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near<TCoordinates>(SearchPathDefinition<TDocument>, GeoJsonPoint<TCoordinates>, double, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near<TField>(Expression<Func<TDocument, TField>>, DateTime, long, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near<TField>(Expression<Func<TDocument, TField>>, double, double, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near<TField>(Expression<Func<TDocument, TField>>, int, int, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near<TField>(Expression<Func<TDocument, TField>>, long, long, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Near<TCoordinates, TField>(Expression<Func<TDocument, TField>>, GeoJsonPoint<TCoordinates>, double, SearchScoreDefinition<TDocument>)

Creates a search definition that supports querying and scoring numeric and date values.

Phrase(SearchPathDefinition<TDocument>, SearchQueryDefinition, int?, SearchScoreDefinition<TDocument>)

Creates a search definition that performs search for documents containing an ordered sequence of terms.

Phrase<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, int?, SearchScoreDefinition<TDocument>)

Creates a search definition that performs search for documents containing an ordered sequence of terms.

QueryString(FieldDefinition<TDocument>, string, SearchScoreDefinition<TDocument>)

Creates a search definition that queries a combination of indexed fields and values.

QueryString<TField>(Expression<Func<TDocument, TField>>, string, SearchScoreDefinition<TDocument>)

Creates a search definition that queries a combination of indexed fields and values.

Range<TField>(SearchPathDefinition<TDocument>, SearchRange<TField>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for documents where a field is in the specified range.

Range<TField>(Expression<Func<TDocument, TField>>, SearchRange<TField>, SearchScoreDefinition<TDocument>)

Creates a search definition that queries for documents where a field is in the specified range.

Regex(SearchPathDefinition<TDocument>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)

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

Regex<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)

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

Span(SearchSpanDefinition<TDocument>)

Creates a search definition that finds text search matches within regions of a text field.

Text(SearchPathDefinition<TDocument>, SearchQueryDefinition, SearchFuzzyOptions, SearchScoreDefinition<TDocument>)

Creates a search definition that performs full-text search using the analyzer specified in the index configuration.

Text(SearchPathDefinition<TDocument>, SearchQueryDefinition, string, SearchScoreDefinition<TDocument>)

Creates a search definition that performs full-text search with synonyms using the analyzer specified in the index configuration.

Text<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, SearchFuzzyOptions, SearchScoreDefinition<TDocument>)

Creates a search definition that performs full-text search using the analyzer specified in the index configuration.

Text<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, string, SearchScoreDefinition<TDocument>)

Creates a search definition that performs full-text search with synonyms using the analyzer specified in the index configuration.

Wildcard(SearchPathDefinition<TDocument>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)

Creates a search definition that uses special characters in the search string that can match any character.

Wildcard<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)

Creates a search definition that uses special characters in the search string that can match any character.