SearchIndex Class
Represents a search index definition, which describes the fields and search behavior of an index.
Constructor
SearchIndex(*args: Any, **kwargs: Any)
Variables
| Name | Description |
|---|---|
|
name
|
The name of the index. Required. |
|
description
|
The description of the index. |
|
fields
|
The fields of the index. Required. |
|
scoring_profiles
|
The scoring profiles for the index. |
|
default_scoring_profile
|
The name of the scoring profile to use if none is specified in the query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used. |
|
cors_options
|
Options to control Cross-Origin Resource Sharing (CORS) for the index. |
|
suggesters
|
The suggesters for the index. |
|
analyzers
|
The analyzers for the index. |
|
tokenizers
|
The tokenizers for the index. |
|
token_filters
|
The token filters for the index. |
|
char_filters
|
The character filters for the index. |
|
normalizers
|
The normalizers for the index. |
|
encryption_key
|
A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data. Once you have encrypted your data, it will always remain encrypted. The search service will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. |
|
similarity
|
The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. |
|
semantic_search
|
Defines parameters for a search index that influence semantic capabilities. |
|
vector_search
|
Contains configuration options related to vector search. |
|
e_tag
|
The ETag of the index. |
Methods
| as_dict |
Return a dict that can be turned into json using json.dump. |
| clear |
Remove all items from D. |
| copy | |
| get |
Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None :returns: D[k] if k in D, else d. :rtype: any |
| items | |
| keys | |
| pop |
Removes specified key and return the corresponding value. :param str key: The key to pop. :param any default: The value to return if key is not in the dictionary :returns: The value corresponding to the key. :rtype: any :raises KeyError: If key is not found and default is not given. |
| popitem |
Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple :raises KeyError: if D is empty. |
| setdefault |
Same as calling D.get(k, d), and setting D[k]=d if k not found :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary :returns: D[k] if k in D, else d. :rtype: any |
| update |
Updates D from mapping/iterable E and F. :param any args: Either a mapping object or an iterable of key-value pairs. |
| values |
as_dict
Return a dict that can be turned into json using json.dump.
as_dict(*, exclude_readonly: bool = False) -> dict[str, Any]
Keyword-Only Parameters
| Name | Description |
|---|---|
|
exclude_readonly
|
Whether to remove the readonly properties. Default value: False
|
Returns
| Type | Description |
|---|---|
|
A dict JSON compatible object |
clear
Remove all items from D.
clear() -> None
copy
copy() -> Model
get
Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None :returns: D[k] if k in D, else d. :rtype: any
get(key: str, default: Any = None) -> Any
Parameters
| Name | Description |
|---|---|
|
key
Required
|
|
|
default
|
Default value: None
|
items
items() -> ItemsView[str, Any]
Returns
| Type | Description |
|---|---|
|
set-like object providing a view on D's items |
keys
keys() -> KeysView[str]
Returns
| Type | Description |
|---|---|
|
a set-like object providing a view on D's keys |
pop
Removes specified key and return the corresponding value. :param str key: The key to pop. :param any default: The value to return if key is not in the dictionary :returns: The value corresponding to the key. :rtype: any :raises KeyError: If key is not found and default is not given.
pop(key: str, default: ~typing.Any = <object object>) -> Any
Parameters
| Name | Description |
|---|---|
|
key
Required
|
|
|
default
|
|
popitem
Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple :raises KeyError: if D is empty.
popitem() -> tuple[str, Any]
setdefault
Same as calling D.get(k, d), and setting D[k]=d if k not found :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary :returns: D[k] if k in D, else d. :rtype: any
setdefault(key: str, default: ~typing.Any = <object object>) -> Any
Parameters
| Name | Description |
|---|---|
|
key
Required
|
|
|
default
|
|
update
Updates D from mapping/iterable E and F. :param any args: Either a mapping object or an iterable of key-value pairs.
update(*args: Any, **kwargs: Any) -> None
values
values() -> ValuesView[Any]
Returns
| Type | Description |
|---|---|
|
an object providing a view on D's values |
Attributes
analyzers
The analyzers for the index.
analyzers: list['_models.LexicalAnalyzer'] | None
char_filters
The character filters for the index.
char_filters: list['_models.CharFilter'] | None
cors_options
Options to control Cross-Origin Resource Sharing (CORS) for the index.
cors_options: _models.CorsOptions | None
default_scoring_profile
The name of the scoring profile to use if none is specified in the query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used.
default_scoring_profile: str | None
description
The description of the index.
description: str | None
e_tag
The ETag of the index.
e_tag: str | None
encryption_key
A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data. Once you have encrypted your data, it will always remain encrypted. The search service will ignore attempts to set this property to null. You can change this property as needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019.
encryption_key: _models.SearchResourceEncryptionKey | None
fields
The fields of the index. Required.
fields: list['_models.SearchField']
name
The name of the index. Required.
name: str
normalizers
The normalizers for the index.
normalizers: list['_models.LexicalNormalizer'] | None
scoring_profiles
The scoring profiles for the index.
scoring_profiles: list['_models.ScoringProfile'] | None
semantic_search
Defines parameters for a search index that influence semantic capabilities.
semantic_search: _models.SemanticSearch | None
similarity
The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used.
similarity: _models.SimilarityAlgorithm | None
suggesters
The suggesters for the index.
suggesters: list['_models.SearchSuggester'] | None
token_filters
The token filters for the index.
token_filters: list['_models.TokenFilter'] | None
tokenizers
The tokenizers for the index.
tokenizers: list['_models.LexicalTokenizer'] | None
vector_search
Contains configuration options related to vector search.
vector_search: _models.VectorSearch | None