Class SearchDefinitionBuilder<TDocument>
A builder for a search definition.
public sealed class SearchDefinitionBuilder<TDocument>
Type Parameters
TDocumentThe 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.
public SearchDefinition<TDocument> Autocomplete(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, SearchAutocompleteTokenOrder tokenOrder = SearchAutocompleteTokenOrder.Any, SearchFuzzyOptions fuzzy = null, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field to search.
querySearchQueryDefinitionThe query definition specifying the string or strings to search for.
tokenOrderSearchAutocompleteTokenOrderThe order in which to search for tokens.
fuzzySearchFuzzyOptionsThe options for fuzzy search.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
An autocomplete search definition.
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.
public SearchDefinition<TDocument> Autocomplete<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, SearchAutocompleteTokenOrder tokenOrder = SearchAutocompleteTokenOrder.Any, SearchFuzzyOptions fuzzy = null, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field to search.
querySearchQueryDefinitionThe query definition specifying the string or strings to search for.
tokenOrderSearchAutocompleteTokenOrderThe order in which to search for tokens.
fuzzySearchFuzzyOptionsThe options for fuzzy search.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
An autocomplete search definition.
Type Parameters
TFieldThe type of the field.
Compound(SearchScoreDefinition<TDocument>)
Creates a builder for a compound search definition.
public CompoundSearchDefinitionBuilder<TDocument> Compound(SearchScoreDefinition<TDocument> score = null)
Parameters
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
A compound search definition builder.
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.
public SearchDefinition<TDocument> EmbeddedDocument<TField>(FieldDefinition<TDocument, IEnumerable<TField>> path, SearchDefinition<TField> @operator, SearchScoreDefinition<TDocument> score = null)
Parameters
pathFieldDefinition<TDocument, IEnumerable<TField>>The indexed field to search.
operatorSearchDefinition<TField>The operator.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
An embeddedDocument search definition.
Type Parameters
TFieldThe type of the field.
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.
public SearchDefinition<TDocument> EmbeddedDocument<TField>(Expression<Func<TDocument, IEnumerable<TField>>> path, SearchDefinition<TField> @operator, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, IEnumerable<TField>>>The indexed field to search.
operatorSearchDefinition<TField>The operator.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
An embeddedDocument search definition.
Type Parameters
TFieldThe type of the field.
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 boolean, numeric, ObjectId and date.
public SearchDefinition<TDocument> Equals<TField>(FieldDefinition<TDocument, TField> path, TField value, SearchScoreDefinition<TDocument> score = null) where TField : struct, IComparable<TField>
Parameters
pathFieldDefinition<TDocument, TField>The indexed field to search.
valueTFieldThe value to query for.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
An equality search definition.
Type Parameters
TFieldThe type of the field.
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 boolean, numeric, ObjectId and date.
public SearchDefinition<TDocument> Equals<TField>(Expression<Func<TDocument, TField>> path, TField value, SearchScoreDefinition<TDocument> score = null) where TField : struct, IComparable<TField>
Parameters
pathExpression<Func<TDocument, TField>>The indexed field to search.
valueTFieldThe value to query for.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
An equality search definition.
Type Parameters
TFieldThe type of the field.
Exists(FieldDefinition<TDocument>)
Creates a search definition that tests if a path to a specified indexed field name exists in a document.
public SearchDefinition<TDocument> Exists(FieldDefinition<TDocument> path)
Parameters
pathFieldDefinition<TDocument>The field to test for.
Returns
- SearchDefinition<TDocument>
An existence search definition.
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.
public SearchDefinition<TDocument> Exists<TField>(Expression<Func<TDocument, TField>> path)
Parameters
pathExpression<Func<TDocument, TField>>The field to test for.
Returns
- SearchDefinition<TDocument>
An existence search definition.
Type Parameters
TFieldThe type of the field.
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.
public SearchDefinition<TDocument> Facet(SearchDefinition<TDocument> @operator, params SearchFacet<TDocument>[] facets)
Parameters
operatorSearchDefinition<TDocument>The operator to use to perform the facet over.
facetsSearchFacet<TDocument>[]Information for bucketing the data for each facet.
Returns
- SearchDefinition<TDocument>
A facet search definition.
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.
public SearchDefinition<TDocument> Facet(SearchDefinition<TDocument> @operator, IEnumerable<SearchFacet<TDocument>> facets)
Parameters
operatorSearchDefinition<TDocument>The operator to use to perform the facet over.
facetsIEnumerable<SearchFacet<TDocument>>Information for bucketing the data for each facet.
Returns
- SearchDefinition<TDocument>
A facet search definition.
GeoShape<TCoordinates>(SearchPathDefinition<TDocument>, GeoShapeRelation, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)
Creates a search definition that queries for shapes with a given geometry.
public SearchDefinition<TDocument> GeoShape<TCoordinates>(SearchPathDefinition<TDocument> path, GeoShapeRelation relation, GeoJsonGeometry<TCoordinates> geometry, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates
Parameters
pathSearchPathDefinition<TDocument>Indexed geo type field or fields to search.
relationGeoShapeRelationRelation of the query shape geometry to the indexed field geometry.
geometryGeoJsonGeometry<TCoordinates>GeoJSON object specifying the Polygon, MultiPolygon, or LineString shape or point to search.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A geo shape search definition.
Type Parameters
TCoordinatesThe type of the coordinates.
GeoShape<TCoordinates, TField>(Expression<Func<TDocument, TField>>, GeoShapeRelation, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)
Creates a search definition that queries for shapes with a given geometry.
public SearchDefinition<TDocument> GeoShape<TCoordinates, TField>(Expression<Func<TDocument, TField>> path, GeoShapeRelation relation, GeoJsonGeometry<TCoordinates> geometry, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates
Parameters
pathExpression<Func<TDocument, TField>>Indexed geo type field or fields to search.
relationGeoShapeRelationRelation of the query shape geometry to the indexed field geometry.
geometryGeoJsonGeometry<TCoordinates>GeoJSON object specifying the Polygon, MultiPolygon, or LineString shape or point to search.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A geo shape search definition.
Type Parameters
TCoordinatesThe type of the coordinates.
TFieldThe type of the field.
GeoWithin<TCoordinates>(SearchPathDefinition<TDocument>, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)
Creates a search definition that queries for geographic points within a given geometry.
public SearchDefinition<TDocument> GeoWithin<TCoordinates>(SearchPathDefinition<TDocument> path, GeoJsonGeometry<TCoordinates> geometry, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates
Parameters
pathSearchPathDefinition<TDocument>Indexed geo type field or fields to search.
geometryGeoJsonGeometry<TCoordinates>GeoJSON object specifying the MultiPolygon or Polygon to search within.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A geo within search definition.
Type Parameters
TCoordinatesThe type of the coordinates.
GeoWithin<TCoordinates>(SearchPathDefinition<TDocument>, GeoWithinArea<TCoordinates>, SearchScoreDefinition<TDocument>)
Creates a search definition that queries for geographic points within a given geo object.
public SearchDefinition<TDocument> GeoWithin<TCoordinates>(SearchPathDefinition<TDocument> path, GeoWithinArea<TCoordinates> area, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates
Parameters
pathSearchPathDefinition<TDocument>Indexed geo type field or fields to search.
areaGeoWithinArea<TCoordinates>Object that specifies the area to search within.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A geo within search definition.
Type Parameters
TCoordinatesThe type of the coordinates.
GeoWithin<TCoordinates, TField>(Expression<Func<TDocument, TField>>, GeoJsonGeometry<TCoordinates>, SearchScoreDefinition<TDocument>)
Creates a search definition that queries for geographic points within a given geometry.
public SearchDefinition<TDocument> GeoWithin<TCoordinates, TField>(Expression<Func<TDocument, TField>> path, GeoJsonGeometry<TCoordinates> geometry, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates
Parameters
pathExpression<Func<TDocument, TField>>Indexed geo type field or fields to search.
geometryGeoJsonGeometry<TCoordinates>GeoJSON object specifying the MultiPolygon or Polygon to search within.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A geo within search definition.
Type Parameters
TCoordinatesThe type of the coordinates.
TFieldThe type of the field.
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.
public SearchDefinition<TDocument> GeoWithin<TCoordinates, TField>(Expression<Func<TDocument, TField>> path, GeoWithinArea<TCoordinates> area, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates
Parameters
pathExpression<Func<TDocument, TField>>Indexed geo type field or fields to search.
areaGeoWithinArea<TCoordinates>Object that specifies the area to search within.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A geo within search definition.
Type Parameters
TCoordinatesThe type of the coordinates.
TFieldThe type of the field.
MoreLikeThis<TLike>(IEnumerable<TLike>)
Creates a search definition that returns documents similar to the input documents.
public SearchDefinition<TDocument> MoreLikeThis<TLike>(IEnumerable<TLike> like)
Parameters
likeIEnumerable<TLike>One or more documents that Atlas Search uses to extract representative terms for.
Returns
- SearchDefinition<TDocument>
A more like this search definition.
Type Parameters
TLikeThe type of the like documents.
MoreLikeThis<TLike>(params TLike[])
Creates a search definition that returns documents similar to the input documents.
public SearchDefinition<TDocument> MoreLikeThis<TLike>(params TLike[] like)
Parameters
likeTLike[]One or more documents that Atlas Search uses to extract representative terms for.
Returns
- SearchDefinition<TDocument>
A more like this search definition.
Type Parameters
TLikeThe type of the like documents.
Near(SearchPathDefinition<TDocument>, DateTime, long, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near(SearchPathDefinition<TDocument> path, DateTime origin, long pivot, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
originDateTimeThe number, date, or geographic point to search near.
pivotlongThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Near(SearchPathDefinition<TDocument>, double, double, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near(SearchPathDefinition<TDocument> path, double origin, double pivot, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
origindoubleThe number, date, or geographic point to search near.
pivotdoubleThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Near(SearchPathDefinition<TDocument>, int, int, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near(SearchPathDefinition<TDocument> path, int origin, int pivot, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
originintThe number, date, or geographic point to search near.
pivotintThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Near(SearchPathDefinition<TDocument>, long, long, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near(SearchPathDefinition<TDocument> path, long origin, long pivot, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
originlongThe number, date, or geographic point to search near.
pivotlongThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Near<TCoordinates>(SearchPathDefinition<TDocument>, GeoJsonPoint<TCoordinates>, double, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near<TCoordinates>(SearchPathDefinition<TDocument> path, GeoJsonPoint<TCoordinates> origin, double pivot, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
originGeoJsonPoint<TCoordinates>The number, date, or geographic point to search near.
pivotdoubleThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Type Parameters
TCoordinatesThe type of the coordinates.
Near<TField>(Expression<Func<TDocument, TField>>, DateTime, long, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near<TField>(Expression<Func<TDocument, TField>> path, DateTime origin, long pivot, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
originDateTimeThe number, date, or geographic point to search near.
pivotlongThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Type Parameters
TFieldThe type of the field.
Near<TField>(Expression<Func<TDocument, TField>>, double, double, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near<TField>(Expression<Func<TDocument, TField>> path, double origin, double pivot, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
origindoubleThe number, date, or geographic point to search near.
pivotdoubleThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Type Parameters
TFieldThe type of the field.
Near<TField>(Expression<Func<TDocument, TField>>, int, int, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near<TField>(Expression<Func<TDocument, TField>> path, int origin, int pivot, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
originintThe number, date, or geographic point to search near.
pivotintThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Type Parameters
TFieldThe type of the field.
Near<TField>(Expression<Func<TDocument, TField>>, long, long, SearchScoreDefinition<TDocument>)
Creates a search definition that supports querying and scoring numeric and date values.
public SearchDefinition<TDocument> Near<TField>(Expression<Func<TDocument, TField>> path, long origin, long pivot, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
originlongThe number, date, or geographic point to search near.
pivotlongThe value to use to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Type Parameters
TFieldThe type of the field.
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.
public SearchDefinition<TDocument> Near<TCoordinates, TField>(Expression<Func<TDocument, TField>> path, GeoJsonPoint<TCoordinates> origin, double pivot, SearchScoreDefinition<TDocument> score = null) where TCoordinates : GeoJsonCoordinates
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
originGeoJsonPoint<TCoordinates>The number, date, or geographic point to search near.
pivotdoubleThe value to user to calculate scores of result documents.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A near search definition.
Type Parameters
TCoordinatesThe type of the coordinates
TFieldThe type of the fields.
Phrase(SearchPathDefinition<TDocument>, SearchQueryDefinition, int?, SearchScoreDefinition<TDocument>)
Creates a search definition that performs search for documents containing an ordered sequence of terms.
public SearchDefinition<TDocument> Phrase(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, int? slop = null, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
querySearchQueryDefinitionThe string or strings to search for.
slopint?The allowable distance between words in the query phrase.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A phrase search definition.
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.
public SearchDefinition<TDocument> Phrase<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, int? slop = null, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
querySearchQueryDefinitionThe string or strings to search for.
slopint?The allowable distance between words in the query phrase.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A phrase search definition.
Type Parameters
TFieldThe type of the field.
QueryString(FieldDefinition<TDocument>, string, SearchScoreDefinition<TDocument>)
Creates a search definition that queries a combination of indexed fields and values.
public SearchDefinition<TDocument> QueryString(FieldDefinition<TDocument> defaultPath, string query, SearchScoreDefinition<TDocument> score = null)
Parameters
defaultPathFieldDefinition<TDocument>The indexed field to search by default.
querystringOne or more indexed fields and values to search.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A query string search definition.
QueryString<TField>(Expression<Func<TDocument, TField>>, string, SearchScoreDefinition<TDocument>)
Creates a search definition that queries a combination of indexed fields and values.
public SearchDefinition<TDocument> QueryString<TField>(Expression<Func<TDocument, TField>> defaultPath, string query, SearchScoreDefinition<TDocument> score = null)
Parameters
defaultPathExpression<Func<TDocument, TField>>The indexed field to search by default.
querystringOne or more indexed fields and values to search.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A query string search definition.
Type Parameters
TFieldThe type of the field.
Range<TField>(SearchPathDefinition<TDocument>, SearchRange<TField>, SearchScoreDefinition<TDocument>)
Creates a search definition that queries for documents where a field is in the specified range.
public SearchDefinition<TDocument> Range<TField>(SearchPathDefinition<TDocument> path, SearchRange<TField> range, SearchScoreDefinition<TDocument> score = null) where TField : struct, IComparable<TField>
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
rangeSearchRange<TField>The field range.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A a range search definition.
Type Parameters
TFieldThe type of the field.
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.
public SearchDefinition<TDocument> Range<TField>(Expression<Func<TDocument, TField>> path, SearchRange<TField> range, SearchScoreDefinition<TDocument> score = null) where TField : struct, IComparable<TField>
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
rangeSearchRange<TField>The field range.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A a range search definition.
Type Parameters
TFieldThe type of the field.
Regex(SearchPathDefinition<TDocument>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)
Creates a search definition that interprets the query as a regular expression.
public SearchDefinition<TDocument> Regex(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, bool allowAnalyzedField = false, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
querySearchQueryDefinitionThe string or strings to search for.
allowAnalyzedFieldboolMust be set to true if the query is run against an analyzed field.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A regular expression search definition.
Regex<TField>(Expression<Func<TDocument, TField>>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)
Creates a search definition that interprets the query as a regular expression.
public SearchDefinition<TDocument> Regex<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, bool allowAnalyzedField = false, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
querySearchQueryDefinitionThe string or strings to search for.
allowAnalyzedFieldboolMust be set to true if the query is run against an analyzed field.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A regular expression search definition.
Type Parameters
TFieldThe type of the field.
Span(SearchSpanDefinition<TDocument>)
Creates a search definition that finds text search matches within regions of a text field.
public SearchDefinition<TDocument> Span(SearchSpanDefinition<TDocument> clause)
Parameters
clauseSearchSpanDefinition<TDocument>The span clause.
Returns
- SearchDefinition<TDocument>
A span search definition.
Text(SearchPathDefinition<TDocument>, SearchQueryDefinition, SearchFuzzyOptions, SearchScoreDefinition<TDocument>)
Creates a search definition that performs full-text search using the analyzer specified in the index configuration.
public SearchDefinition<TDocument> Text(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, SearchFuzzyOptions fuzzy = null, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
querySearchQueryDefinitionThe string or strings to search for.
fuzzySearchFuzzyOptionsThe options for fuzzy search.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A text search definition.
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.
public SearchDefinition<TDocument> Text(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, string synonyms, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
querySearchQueryDefinitionThe string or strings to search for.
synonymsstringThe name of the synonym mapping definition in the index definition
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A text search definition.
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.
public SearchDefinition<TDocument> Text<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, SearchFuzzyOptions fuzzy = null, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or field to search.
querySearchQueryDefinitionThe string or strings to search for.
fuzzySearchFuzzyOptionsThe options for fuzzy search.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A text search definition.
Type Parameters
TFieldThe type of the field.
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.
public SearchDefinition<TDocument> Text<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, string synonyms, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or field to search.
querySearchQueryDefinitionThe string or strings to search for.
synonymsstringThe name of the synonym mapping definition in the index definition
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A text search definition.
Type Parameters
TFieldThe type of the field.
Wildcard(SearchPathDefinition<TDocument>, SearchQueryDefinition, bool, SearchScoreDefinition<TDocument>)
Creates a search definition that uses special characters in the search string that can match any character.
public SearchDefinition<TDocument> Wildcard(SearchPathDefinition<TDocument> path, SearchQueryDefinition query, bool allowAnalyzedField = false, SearchScoreDefinition<TDocument> score = null)
Parameters
pathSearchPathDefinition<TDocument>The indexed field or fields to search.
querySearchQueryDefinitionThe string or strings to search for.
allowAnalyzedFieldboolMust be set to true if the query is run against an analyzed field.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A wildcard search definition.
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.
public SearchDefinition<TDocument> Wildcard<TField>(Expression<Func<TDocument, TField>> path, SearchQueryDefinition query, bool allowAnalyzedField = false, SearchScoreDefinition<TDocument> score = null)
Parameters
pathExpression<Func<TDocument, TField>>The indexed field or fields to search.
querySearchQueryDefinitionThe string or strings to search for.
allowAnalyzedFieldboolMust be set to true if the query is run against an analyzed field.
scoreSearchScoreDefinition<TDocument>The score modifier.
Returns
- SearchDefinition<TDocument>
A wildcard search definition.
Type Parameters
TFieldThe type of the field.