SearchModelFactory.SearchOptions Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Parameters for filtering, sorting, faceting, paging, and other search query behaviors.
public static Azure.Search.Documents.SearchOptions SearchOptions(bool? includeTotalCount = default, System.Collections.Generic.IEnumerable<string> facets = default, string filter = default, string highlightFieldsRaw = default, string highlightPostTag = default, string highlightPreTag = default, double? minimumCoverage = default, string orderByRaw = default, Azure.Search.Documents.Models.SearchQueryType? queryType = default, Azure.Search.Documents.Models.ScoringStatistics? scoringStatistics = default, string sessionId = default, System.Collections.Generic.IEnumerable<string> scoringParameters = default, string scoringProfile = default, Azure.Search.Documents.Models.QueryDebugMode? debug = default, string searchText = default, string searchFieldsRaw = default, Azure.Search.Documents.Models.SearchMode? searchMode = default, string selectRaw = default, int? skip = default, int? size = default, string semanticConfigurationName = default, Azure.Search.Documents.Models.SemanticErrorMode? semanticErrorMode = default, int? semanticMaxWaitInMilliseconds = default, string semanticQuery = default, string queryAnswerRaw = default, string queryCaptionRaw = default, System.Collections.Generic.IEnumerable<Azure.Search.Documents.Models.VectorQuery> vectorQueries = default, Azure.Search.Documents.Models.VectorFilterMode? filterMode = default);
static member SearchOptions : Nullable<bool> * seq<string> * string * string * string * string * Nullable<double> * string * Nullable<Azure.Search.Documents.Models.SearchQueryType> * Nullable<Azure.Search.Documents.Models.ScoringStatistics> * string * seq<string> * string * Nullable<Azure.Search.Documents.Models.QueryDebugMode> * string * string * Nullable<Azure.Search.Documents.Models.SearchMode> * string * Nullable<int> * Nullable<int> * string * Nullable<Azure.Search.Documents.Models.SemanticErrorMode> * Nullable<int> * string * string * string * seq<Azure.Search.Documents.Models.VectorQuery> * Nullable<Azure.Search.Documents.Models.VectorFilterMode> -> Azure.Search.Documents.SearchOptions
Public Shared Function SearchOptions (Optional includeTotalCount As Nullable(Of Boolean) = Nothing, Optional facets As IEnumerable(Of String) = Nothing, Optional filter As String = Nothing, Optional highlightFieldsRaw As String = Nothing, Optional highlightPostTag As String = Nothing, Optional highlightPreTag As String = Nothing, Optional minimumCoverage As Nullable(Of Double) = Nothing, Optional orderByRaw As String = Nothing, Optional queryType As Nullable(Of SearchQueryType) = Nothing, Optional scoringStatistics As Nullable(Of ScoringStatistics) = Nothing, Optional sessionId As String = Nothing, Optional scoringParameters As IEnumerable(Of String) = Nothing, Optional scoringProfile As String = Nothing, Optional debug As Nullable(Of QueryDebugMode) = Nothing, Optional searchText As String = Nothing, Optional searchFieldsRaw As String = Nothing, Optional searchMode As Nullable(Of SearchMode) = Nothing, Optional selectRaw As String = Nothing, Optional skip As Nullable(Of Integer) = Nothing, Optional size As Nullable(Of Integer) = Nothing, Optional semanticConfigurationName As String = Nothing, Optional semanticErrorMode As Nullable(Of SemanticErrorMode) = Nothing, Optional semanticMaxWaitInMilliseconds As Nullable(Of Integer) = Nothing, Optional semanticQuery As String = Nothing, Optional queryAnswerRaw As String = Nothing, Optional queryCaptionRaw As String = Nothing, Optional vectorQueries As IEnumerable(Of VectorQuery) = Nothing, Optional filterMode As Nullable(Of VectorFilterMode) = Nothing) As SearchOptions
Parameters
A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation.
- facets
- IEnumerable<String>
The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs.
- filter
- String
The OData $filter expression to apply to the search query.
- highlightFieldsRaw
- String
The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting.
- highlightPostTag
- String
A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>.
- highlightPreTag
- String
A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>.
A number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100.
- orderByRaw
- String
The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses.
- queryType
- Nullable<SearchQueryType>
A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax.
- scoringStatistics
- Nullable<ScoringStatistics>
A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries.
- sessionId
- String
A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character.
- scoringParameters
- IEnumerable<String>
The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes).
- scoringProfile
- String
The name of a scoring profile to evaluate match scores for matching documents in order to sort the results.
- debug
- Nullable<QueryDebugMode>
Enables a debugging tool that can be used to further explore your reranked results.
- searchText
- String
A full-text search query expression; Use "*" or omit this parameter to match all documents.
- searchFieldsRaw
- String
The comma-separated list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter.
- searchMode
- Nullable<SearchMode>
A value that specifies whether any or all of the search terms must be matched in order to count the document as a match.
- selectRaw
- String
The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included.
The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use skip due to this limitation, consider using orderby on a totally-ordered key and filter with a range query instead.
The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results.
- semanticConfigurationName
- String
The name of a semantic configuration that will be used when processing documents for queries of type semantic.
- semanticErrorMode
- Nullable<SemanticErrorMode>
Allows the user to choose whether a semantic call should fail completely (default / current behavior), or to return partial results.
Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish processing before the request fails.
- semanticQuery
- String
Allows setting a separate search query that will be solely used for semantic reranking, semantic captions and semantic answers. Is useful for scenarios where there is a need to use different queries between the base retrieval and ranking phase, and the L2 semantic phase.
- queryAnswerRaw
- String
A value that specifies whether answers should be returned as part of the search response.
- queryCaptionRaw
- String
A value that specifies whether captions should be returned as part of the search response.
- vectorQueries
- IEnumerable<VectorQuery>
The query parameters for vector and hybrid search queries.
- filterMode
- Nullable<VectorFilterMode>
Determines whether or not filters are applied before or after the vector search is performed. Default is 'preFilter' for new indexes.
Returns
A new SearchOptions instance for mocking.