Condividi tramite


Field.New Method

Definition

Creates a new simple Field with required arguments.

public static Microsoft.Azure.Search.Models.Field New (string name, Microsoft.Azure.Search.Models.DataType dataType, bool isKey = false, bool isRetrievable = true, bool isSearchable = false, bool isFilterable = false, bool isSortable = false, bool isFacetable = false, Microsoft.Azure.Search.Models.AnalyzerName? analyzerName = default, Microsoft.Azure.Search.Models.AnalyzerName? searchAnalyzerName = default, Microsoft.Azure.Search.Models.AnalyzerName? indexAnalyzerName = default, System.Collections.Generic.IList<string> synonymMaps = default);
static member New : string * Microsoft.Azure.Search.Models.DataType * bool * bool * bool * bool * bool * bool * Nullable<Microsoft.Azure.Search.Models.AnalyzerName> * Nullable<Microsoft.Azure.Search.Models.AnalyzerName> * Nullable<Microsoft.Azure.Search.Models.AnalyzerName> * System.Collections.Generic.IList<string> -> Microsoft.Azure.Search.Models.Field
Public Shared Function New (name As String, dataType As DataType, Optional isKey As Boolean = false, Optional isRetrievable As Boolean = true, Optional isSearchable As Boolean = false, Optional isFilterable As Boolean = false, Optional isSortable As Boolean = false, Optional isFacetable As Boolean = false, Optional analyzerName As Nullable(Of AnalyzerName) = Nothing, Optional searchAnalyzerName As Nullable(Of AnalyzerName) = Nothing, Optional indexAnalyzerName As Nullable(Of AnalyzerName) = Nothing, Optional synonymMaps As IList(Of String) = Nothing) As Field

Parameters

name
String

The name of the simple field.

dataType
DataType

The data type of the simple field. Cannot be a complex type.

isKey
Boolean

A value indicating whether the field uniquely identifies documents in the index. Default is false.

isRetrievable
Boolean

A value indicating whether the field can be returned in a search result. Default is true.

isSearchable
Boolean

A value indicating whether the field is full-text search-able. Default is false.

isFilterable
Boolean

A value indicating whether to enable the field to be referenced in $filter queries. Default is false.

isSortable
Boolean

A value indicating whether to enable the field to be referenced in $orderby expressions. Default is false.

isFacetable
Boolean

A value indicating whether to enable the field to be referenced in facet queries. Default is false.

analyzerName
Nullable<AnalyzerName>

The name of the language analyzer to use for the field. Default is null.

searchAnalyzerName
Nullable<AnalyzerName>

The name of the analyzer used at search time for the field. Default is null.

indexAnalyzerName
Nullable<AnalyzerName>

The name of the analyzer used at indexing time for the field. Default is null.

synonymMaps
IList<String>

A list of synonym map names that associates synonym maps with the field. Default is null.

Returns

Exceptions

Thrown if dataType is a complex type.

Applies to