-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Search] Update for missing properties #21205
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
Changes from all commits
8e501fa
a95ca85
69fcff0
37ca443
7a3ea28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,12 +97,18 @@ def list_indexes(self, **kwargs): | |
| # type: (**Any) -> ItemPaged[SearchIndex] | ||
| """List the indexes in an Azure Search service. | ||
|
|
||
| :keyword select: Selects which top-level properties of the skillsets to retrieve. Specified as a | ||
| list of JSON property names, or '*' for all properties. The default is all | ||
| properties. | ||
| :paramtype select: list[str] | ||
|
||
| :return: List of indexes | ||
| :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.SearchIndex] | ||
| :raises: ~azure.core.exceptions.HttpResponseError | ||
|
|
||
| """ | ||
| kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) | ||
| if kwargs.get('select', None): | ||
| kwargs['select'] = ','.join(kwargs['select']) | ||
| # pylint:disable=protected-access | ||
| return self._client.indexes.list( | ||
| cls=lambda objs: [SearchIndex._from_generated(x) for x in objs], **kwargs | ||
|
|
@@ -306,6 +312,10 @@ def get_synonym_maps(self, **kwargs): | |
| # type: (**Any) -> List[SynonymMap] | ||
| """List the Synonym Maps in an Azure Search service. | ||
|
|
||
| :keyword select: Selects which top-level properties of the skillsets to retrieve. Specified as a | ||
| list of JSON property names, or '*' for all properties. The default is all | ||
| properties. | ||
| :paramtype select: list[str] | ||
| :return: List of synonym maps | ||
| :rtype: list[~azure.search.documents.indexes.models.SynonymMap] | ||
| :raises: ~azure.core.exceptions.HttpResponseError | ||
|
|
@@ -321,6 +331,8 @@ def get_synonym_maps(self, **kwargs): | |
|
|
||
| """ | ||
| kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) | ||
| if kwargs.get('select', None): | ||
| kwargs['select'] = ','.join(kwargs['select']) | ||
| result = self._client.synonym_maps.list(**kwargs) | ||
| # pylint:disable=protected-access | ||
| return [SynonymMap._from_generated(x) for x in result.synonym_maps] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we only need to pass in **kwargs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially, no we can't do that. All of the kwargs get popped in the lines above this section and then plugged in directly to the
SearchQueryconstructor. I tried to remove that, but then the kwargs get passed along toSearchItemPagedandrequestblows up due to unexpected keyword arguments, which doesn't seem to be an easy fix. So there's really no value add in deviating from the existing pattern here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure if I understand correctly, what we need is to pop unwanted parameters before
return SearchItemPaged(
self._client, query, kwargs, page_iterator_class=SearchPageIterator
)
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, you can do that, but it sort of becomes a "six in one hand, half-dozen in the other" kind of thing. It's not better or worse, just different. Given that, I opted to keep it consistent with what was previously there.