Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search: Skill Versions #20431

Merged
merged 17 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sdk/search/azure-search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,29 @@
- `azure.search.documents.models.Captions`
- `azure.search.documents.models.CaptionResult`
- `azure.search.documents.indexes.models.CustomEntityLookupSkillLanguage`
- `azure.search.documents.indexes.models.EntityRecognitionSkillVersion`
- `azure.search.documents.indexes.models.LexicalNormalizerName`
- `azure.search.documents.indexes.models.PIIDetectionSkill`
- `azure.search.documents.indexes.models.PIIDetectionSkillMaskingMode`
- `azure.search.documents.indexes.models.SearchIndexerCache`
- `azure.search.documents.indexes.models.SearchIndexerDataIdentity`
- `azure.search.documents.indexes.models.SearchIndexerDataNoneIdentity`
- `azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity`
- `azure.search.documents.indexes.models.SentimentSkillVersion`
- Added `normalizer_name` property to `AnalyzeTextOptions` model.

### Breaking Changes

- Removed models:
- `azure.search.documents.indexes.models.SentimentSkillV3`
- `azure.search.documents.indexes.models.EntityRecognitionSkillV3`

### Other Changes
- `SentimentSkill` and `EntityRecognitionSkill` can now be created by specifying
the `skill_version` keyword argument with a `SentimentSkillVersion` or
`EntityRecognitionSkillVersion`, respectively. The default behavior if `skill_version`
is not specified is to create a version 1 skill.

## 11.3.0b2 (2021-08-10)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from azure.core.tracing.decorator import distributed_trace

from ._generated import SearchClient as _SearchServiceClient
from ._generated.models import SearchIndexerSkillset
from .models import SearchIndexerSkillset
from ._utils import (
get_access_conditions,
normalize_endpoint,
Expand Down Expand Up @@ -469,7 +469,7 @@ def get_skillsets(self, **kwargs):
"""
kwargs["headers"] = self._merge_client_headers(kwargs.get("headers"))
result = self._client.skillsets.list(**kwargs)
return result.skillsets
return [SearchIndexerSkillset._from_generated(skillset) for skillset in result.skillsets] # pylint:disable=protected-access

@distributed_trace
def get_skillset_names(self, **kwargs):
Expand Down Expand Up @@ -507,7 +507,8 @@ def get_skillset(self, name, **kwargs):

"""
kwargs["headers"] = self._merge_client_headers(kwargs.get("headers"))
return self._client.skillsets.get(name, **kwargs)
result = self._client.skillsets.get(name, **kwargs)
return SearchIndexerSkillset._from_generated(result) # pylint:disable=protected-access

@distributed_trace
def delete_skillset(self, skillset, **kwargs):
Expand Down Expand Up @@ -563,8 +564,9 @@ def create_skillset(self, skillset, **kwargs):

"""
kwargs["headers"] = self._merge_client_headers(kwargs.get("headers"))
result = self._client.skillsets.create(skillset._to_generated(), **kwargs) # pylint:disable=protected-access
return SearchIndexerSkillset._from_generated(result) # pylint:disable=protected-access

return self._client.skillsets.create(skillset, **kwargs)

@distributed_trace
def create_or_update_skillset(self, skillset, **kwargs):
Expand All @@ -586,9 +588,10 @@ def create_or_update_skillset(self, skillset, **kwargs):
)
kwargs.update(access_condition)

return self._client.skillsets.create_or_update(
result = self._client.skillsets.create_or_update(
skillset_name=skillset.name,
skillset=skillset,
skillset=skillset._to_generated(), # pylint:disable=protected-access
error_map=error_map,
**kwargs
)
return SearchIndexerSkillset._from_generated(result) # pylint:disable=protected-access
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from azure.core.tracing.decorator_async import distributed_trace_async

from .._generated.aio import SearchClient as _SearchServiceClient
from .._generated.models import SearchIndexerSkillset
from ..models import SearchIndexerSkillset
from .._utils import (
get_access_conditions,
normalize_endpoint,
Expand Down Expand Up @@ -462,7 +462,7 @@ async def get_skillsets(self, **kwargs):
"""
kwargs["headers"] = self._merge_client_headers(kwargs.get("headers"))
result = await self._client.skillsets.list(**kwargs)
return result.skillsets
return [SearchIndexerSkillset._from_generated(skillset) for skillset in result.skillsets] # pylint:disable=protected-access

@distributed_trace_async
async def get_skillset_names(self, **kwargs):
Expand Down Expand Up @@ -500,7 +500,8 @@ async def get_skillset(self, name, **kwargs):

"""
kwargs["headers"] = self._merge_client_headers(kwargs.get("headers"))
return await self._client.skillsets.get(name, **kwargs)
result = await self._client.skillsets.get(name, **kwargs)
return SearchIndexerSkillset._from_generated(result) # pylint:disable=protected-access

@distributed_trace_async
async def delete_skillset(self, skillset, **kwargs):
Expand Down Expand Up @@ -557,7 +558,8 @@ async def create_skillset(self, skillset, **kwargs):
"""
kwargs["headers"] = self._merge_client_headers(kwargs.get("headers"))

return await self._client.skillsets.create(skillset, **kwargs)
result = await self._client.skillsets.create(skillset, **kwargs)
return SearchIndexerSkillset._from_generated(result) # pylint:disable=protected-access

@distributed_trace_async
async def create_or_update_skillset(self, skillset, **kwargs):
Expand All @@ -579,9 +581,10 @@ async def create_or_update_skillset(self, skillset, **kwargs):
)
kwargs.update(access_condition)

return await self._client.skillsets.create_or_update(
result = await self._client.skillsets.create_or_update(
skillset_name=skillset.name,
skillset=skillset,
skillset=skillset._to_generated(), # pylint:disable=protected-access
error_map=error_map,
**kwargs
)
return SearchIndexerSkillset._from_generated(result) # pylint:disable=protected-access
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
ElisionTokenFilter,
EntityCategory,
EntityLinkingSkill,
EntityRecognitionSkill,
EntityRecognitionSkillLanguage,
EntityRecognitionSkillV3,
FieldMapping,
FieldMappingFunction,
FreshnessScoringFunction,
Expand Down Expand Up @@ -124,15 +122,12 @@
SearchIndexerKnowledgeStoreProjection,
SearchIndexerKnowledgeStoreTableProjectionSelector,
SearchIndexerLimits,
SearchIndexerSkillset,
SearchIndexerStatus,
ScoringFunction,
ScoringFunctionAggregation,
ScoringFunctionInterpolation,
ScoringProfile,
SentimentSkill,
SentimentSkillLanguage,
SentimentSkillV3,
ShaperSkill,
ShingleTokenFilter,
Similarity as SimilarityAlgorithm,
Expand Down Expand Up @@ -169,10 +164,15 @@
from ._models import (
AnalyzeTextOptions,
CustomAnalyzer,
EntityRecognitionSkill,
EntityRecognitionSkillVersion,
PatternAnalyzer,
PatternTokenizer,
SearchIndexerDataSourceConnection,
SearchIndexerSkillset,
SearchResourceEncryptionKey,
SentimentSkill,
SentimentSkillVersion,
SynonymMap,
)

Expand Down Expand Up @@ -207,7 +207,7 @@
"EntityLinkingSkill",
"EntityRecognitionSkill",
tjprescott marked this conversation as resolved.
Show resolved Hide resolved
"EntityRecognitionSkillLanguage",
"EntityRecognitionSkillV3",
"EntityRecognitionSkillVersion",
"FieldMapping",
"FieldMappingFunction",
"FreshnessScoringFunction",
Expand Down Expand Up @@ -286,7 +286,7 @@
"SearchableField",
"SentimentSkill",
tjprescott marked this conversation as resolved.
Show resolved Hide resolved
"SentimentSkillLanguage",
"SentimentSkillV3",
"SentimentSkillVersion",
"ShaperSkill",
"ShingleTokenFilter",
"SimpleField",
Expand Down
Loading