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

SHA e6fa7db931a3e5182e5685630971b64987719938 #17756

Merged
merged 1 commit into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def __getattr__(cls, name):


class AutocompleteMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles
and 'oneTermWithContext' to use the current context in producing autocomplete terms.
"""

#: Only one term is suggested. If the query has two terms, only the last term is completed. For
#: example, if the input is 'washington medic', the suggested terms could include 'medicaid',
Expand Down Expand Up @@ -60,6 +63,9 @@ class IndexActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
DELETE = "delete"

class QueryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query
uses the Lucene query syntax.
"""

#: Uses the simple query syntax for searches. Search text is interpreted using a simple query
#: language that allows for symbols such as +, * and "". Queries are evaluated across all
Expand All @@ -71,13 +77,21 @@ class QueryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
FULL = "full"

class ScoringStatistics(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""A value that specifies whether we want to calculate scoring statistics (such as document
frequency) globally for more consistent scoring, or locally, for lower latency. The default is
'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global
scoring statistics can increase latency of search queries.
"""

#: The scoring statistics will be calculated locally for lower latency.
LOCAL = "local"
#: The scoring statistics will be calculated globally for more consistent scoring.
GLOBAL_ENUM = "global"

class SearchMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Specifies whether any or all of the search terms must be matched in order to count the document
as a match.
"""

#: Any of the search terms must be matched in order to count the document as a match.
ANY = "any"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ async def search_get(
_scoring_parameters = None
_scoring_profile = None
_search_fields = None
_query_language = None
_speller = None
_answers = None
_search_mode = None
_scoring_statistics = None
_session_id = None
Expand All @@ -161,6 +164,9 @@ async def search_get(
_scoring_parameters = search_options.scoring_parameters
_scoring_profile = search_options.scoring_profile
_search_fields = search_options.search_fields
_query_language = search_options.query_language
_speller = search_options.speller
_answers = search_options.answers
_search_mode = search_options.search_mode
_scoring_statistics = search_options.scoring_statistics
_session_id = search_options.session_id
Expand Down Expand Up @@ -206,6 +212,12 @@ async def search_get(
query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str')
if _search_fields is not None:
query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',')
if _query_language is not None:
query_parameters['queryLanguage'] = self._serialize.query("query_language", _query_language, 'str')
if _speller is not None:
query_parameters['speller'] = self._serialize.query("speller", _speller, 'str')
if _answers is not None:
query_parameters['answers'] = self._serialize.query("answers", _answers, 'str')
if _search_mode is not None:
query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str')
if _scoring_statistics is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
# --------------------------------------------------------------------------

try:
from ._models_py3 import AnswerResult
from ._models_py3 import AutocompleteItem
from ._models_py3 import AutocompleteOptions
from ._models_py3 import AutocompleteRequest
from ._models_py3 import AutocompleteResult
from ._models_py3 import CaptionResult
from ._models_py3 import FacetResult
from ._models_py3 import IndexAction
from ._models_py3 import IndexBatch
Expand All @@ -27,10 +29,12 @@
from ._models_py3 import SuggestRequest
from ._models_py3 import SuggestResult
except (SyntaxError, ImportError):
from ._models import AnswerResult # type: ignore
from ._models import AutocompleteItem # type: ignore
from ._models import AutocompleteOptions # type: ignore
from ._models import AutocompleteRequest # type: ignore
from ._models import AutocompleteResult # type: ignore
from ._models import CaptionResult # type: ignore
from ._models import FacetResult # type: ignore
from ._models import IndexAction # type: ignore
from ._models import IndexBatch # type: ignore
Expand All @@ -48,18 +52,23 @@
from ._models import SuggestResult # type: ignore

from ._search_client_enums import (
Answers,
AutocompleteMode,
IndexActionType,
QueryLanguage,
QueryType,
ScoringStatistics,
SearchMode,
Speller,
)

__all__ = [
'AnswerResult',
'AutocompleteItem',
'AutocompleteOptions',
'AutocompleteRequest',
'AutocompleteResult',
'CaptionResult',
'FacetResult',
'IndexAction',
'IndexBatch',
Expand All @@ -75,9 +84,12 @@
'SuggestOptions',
'SuggestRequest',
'SuggestResult',
'Answers',
'AutocompleteMode',
'IndexActionType',
'QueryLanguage',
'QueryType',
'ScoringStatistics',
'SearchMode',
'Speller',
]
Loading