Class SearchField
Represents a field in an index definition, which describes the name, data type, and search behavior of a field.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Search.Documents.dll
Syntax
public class SearchField
Constructors
SearchField(String, SearchFieldDataType)
Initializes a new instance of the SearchField class.
Declaration
public SearchField (string name, Azure.Search.Documents.Indexes.Models.SearchFieldDataType type);
Parameters
System.String
name
The name of the field, which must be unique within the index or parent field. |
SearchFieldDataType
type
The data type of the field. |
Exceptions
System.ArgumentException
|
System.ArgumentNullException
|
Properties
AnalyzerName
Gets or sets the name of the analyzer to use for the field. This option can be used only with searchable fields and it cannot be set together with either SearchAnalyzerName or IndexAnalyzerName. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields.
Declaration
public Nullable<Azure.Search.Documents.Indexes.Models.LexicalAnalyzerName> AnalyzerName { get; set; }
Property Value
System.Nullable<LexicalAnalyzerName>
|
Fields
Gets a list of nested fields if this field is of type Complex or "Collection(DataType.Complex)".
Declaration
public System.Collections.Generic.IList<Azure.Search.Documents.Indexes.Models.SearchField> Fields { get; }
Property Value
System.Collections.Generic.IList<SearchField>
|
IndexAnalyzerName
Gets or sets the name of the analyzer used at indexing time for the field. This option can be used only with searchable fields. It must be set together with SearchAnalyzerName and it cannot be set together with the AnalyzerName option. This property cannot be set to the name of a language analyzer; use the AnalyzerName property instead if you need a language analyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields.
Declaration
public Nullable<Azure.Search.Documents.Indexes.Models.LexicalAnalyzerName> IndexAnalyzerName { get; set; }
Property Value
System.Nullable<LexicalAnalyzerName>
|
IsFacetable
Gets or sets a value indicating whether the field can be retrieved in facet queries. The default is null. This property must be null for complex fields, but can be set on simple fields within a complex field.
Declaration
public Nullable<bool> IsFacetable { get; set; }
Property Value
System.Nullable<System.Boolean>
|
Remarks
Facets are used in presentation of search results that include hit counts by categories. For example, in a search for digital cameras, facets might include branch, megapixels, price, etc.
This field must be set according to constraints described in the summary, or the server may respond with an error. Instead, consider using the SimpleField, SearchableField, and ComplexField classes to help you more easily create a SearchIndex.
IsFilterable
Gets or sets a value indicating whether the field can be referenced in $filter
queries. The default is null.
This property must be null for complex fields, but can be set on simple fields within a complex field.
Declaration
public Nullable<bool> IsFilterable { get; set; }
Property Value
System.Nullable<System.Boolean>
|
Remarks
Filterable differs from searchable in how strings are handled. Fields of type String or "Collection(DataType.String)" that are filterable do not undergo word-breaking, so comparisons are for exact matches only.
For example, if you set such a field f
to "sunny day", $filter=f eq 'sunny'
will find no matches, but $filter=f eq 'sunny day'
will.
This field must be set according to constraints described in the summary, or the server may respond with an error. Instead, consider using the SimpleField, SearchableField, and ComplexField classes to help you more easily create a SearchIndex.
IsHidden
Gets or sets a value indicating whether the field will be returned in a search result. The default is null. This property must be true for key fields, and must be null for complex fields.
Declaration
public Nullable<bool> IsHidden { get; set; }
Property Value
System.Nullable<System.Boolean>
|
Remarks
You can hide a field from search results if you want to use it only as a filter, for sorting, or for scoring. This property can also be changed on existing fields and enabling it does not cause an increase in index storage requirements.
This field must be set according to constraints described in the summary, or the server may respond with an error. Instead, consider using the SimpleField, SearchableField, and ComplexField classes to help you more easily create a SearchIndex.
IsKey
Gets or sets whether the field is the key field. The default is null. A SearchIndex must have exactly one key field of type String.
Declaration
public Nullable<bool> IsKey { get; set; }
Property Value
System.Nullable<System.Boolean>
|
Remarks
This field must be set according to constraints described in the summary, or the server may respond with an error. Instead, consider using the SimpleField, SearchableField, and ComplexField classes to help you more easily create a SearchIndex.
IsSearchable
Gets or sets a value indicating whether the field is full-text searchable. The default is null. This means it will undergo analysis such as word-breaking during indexing. This property can be true only for String or "Collection(DataType.String)". It must be false for non-string simple fields, and null for complex fields.
Declaration
public Nullable<bool> IsSearchable { get; set; }
Property Value
System.Nullable<System.Boolean>
|
Remarks
Full-text searches enable the field value "sunny day" to be split into individual terms "sunny" and "day". This will increase the size of your index.
This field must be set according to constraints described in the summary, or the server may respond with an error. Instead, consider using the SimpleField, SearchableField, and ComplexField classes to help you more easily create a SearchIndex.
IsSortable
Gets or sets a value indicating whether the field can be referenced in a $orderby
expression. The default is null.
A simple field can be sortable only if it is a single-valued type such as String or Int32.
Declaration
public Nullable<bool> IsSortable { get; set; }
Property Value
System.Nullable<System.Boolean>
|
Remarks
This field must be set according to constraints described in the summary, or the server may respond with an error. Instead, consider using the SimpleField, SearchableField, and ComplexField classes to help you more easily create a SearchIndex.
Name
Gets the name of the field.
Declaration
public string Name { get; }
Property Value
System.String
|
NormalizerName
The name of the normalizer to use for the field. This option can be used only with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed for the field. Must be null for complex fields.
Declaration
public Nullable<Azure.Search.Documents.Indexes.Models.LexicalNormalizerName> NormalizerName { get; set; }
Property Value
System.Nullable<LexicalNormalizerName>
|
SearchAnalyzerName
Gets or sets the name of the analyzer used at search time for the field. This option can be used only with searchable fields. It must be set together with IndexAnalyzerName and it cannot be set together with the AnalyzerName option. This property cannot be set to the name of a language analyzer; use the AnalyzerName property instead if you need a language analyzer. This analyzer can be updated on an existing field. Must be null for complex fields.
Declaration
public Nullable<Azure.Search.Documents.Indexes.Models.LexicalAnalyzerName> SearchAnalyzerName { get; set; }
Property Value
System.Nullable<LexicalAnalyzerName>
|
SynonymMapNames
Gets a list of names of synonym maps associated with this field. Only fields where IsSearchable is true can have associated synonym maps.
Declaration
public System.Collections.Generic.IList<string> SynonymMapNames { get; }
Property Value
System.Collections.Generic.IList<System.String>
|
Type
Ge the data type of the field.
Declaration
public Azure.Search.Documents.Indexes.Models.SearchFieldDataType Type { get; }
Property Value
SearchFieldDataType
|
VectorSearchConfiguration
The name of the vector search algorithm configuration that specifies the algorithm and optional parameters for searching the vector field.
Declaration
public string VectorSearchConfiguration { get; set; }
Property Value
System.String
|
VectorSearchDimensions
The dimensionality of the vector field.
Declaration
public Nullable<int> VectorSearchDimensions { get; set; }
Property Value
System.Nullable<System.Int32>
|