# -*- coding: utf8 -*- # Copyright (c) 2017-2025 Tencent. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import warnings from tencentcloud.common.abstract_model import AbstractModel class SearchProRequest(AbstractModel): r"""SearchPro请求参数结构体 """ def __init__(self): r""" :param _Query:

搜索词

:type Query: str :param _Mode:

返回结果类型,不传默认为0。(极速版不支持该参数)

枚举值:

:type Mode: int :param _Site:

指定网址搜索/过滤。

注意: 该参数与mode参数共同使用时,仅对公开网页信源结果(自然结果)生效,对优质权威垂直信源结果(VR卡)不生效。

:type Site: str :param _Cnt:

控制返回结果条数,可取值:cnt=10/20/30/40/50。(极速版不支持该参数)

枚举值:

:type Cnt: int :param _Industry:

垂直领域搜索。(极速版不支持该参数)

枚举值:

:type Industry: str :param _Freshness:

搜索时效范围,以下五种入参形态不支持混合使用。

示例:2026.6.15分别传参d2/m2/y2进行搜索,则搜索结果的时间范围分别为“2026.6.15、2026.6.14”/“2026.6、2026.5”/“2026、2025”,以此类推。

枚举值:

:type Freshness: str :param _Deeplinks:

返回附件子链信息(仅旗舰版支持该参数)

附件子链信息包括"子链标题"和"子链URL",单个doc最多返回10条子链信息。

:type Deeplinks: bool """ self._Query = None self._Mode = None self._Site = None self._Cnt = None self._Industry = None self._Freshness = None self._Deeplinks = None @property def Query(self): r"""

搜索词

:rtype: str """ return self._Query @Query.setter def Query(self, Query): self._Query = Query @property def Mode(self): r"""

返回结果类型,不传默认为0。(极速版不支持该参数)

枚举值:

:rtype: int """ return self._Mode @Mode.setter def Mode(self, Mode): self._Mode = Mode @property def Site(self): r"""

指定网址搜索/过滤。

注意: 该参数与mode参数共同使用时,仅对公开网页信源结果(自然结果)生效,对优质权威垂直信源结果(VR卡)不生效。

:rtype: str """ return self._Site @Site.setter def Site(self, Site): self._Site = Site @property def Cnt(self): r"""

控制返回结果条数,可取值:cnt=10/20/30/40/50。(极速版不支持该参数)

枚举值:

:rtype: int """ return self._Cnt @Cnt.setter def Cnt(self, Cnt): self._Cnt = Cnt @property def Industry(self): r"""

垂直领域搜索。(极速版不支持该参数)

枚举值:

:rtype: str """ return self._Industry @Industry.setter def Industry(self, Industry): self._Industry = Industry @property def Freshness(self): r"""

搜索时效范围,以下五种入参形态不支持混合使用。

示例:2026.6.15分别传参d2/m2/y2进行搜索,则搜索结果的时间范围分别为“2026.6.15、2026.6.14”/“2026.6、2026.5”/“2026、2025”,以此类推。

枚举值:

:rtype: str """ return self._Freshness @Freshness.setter def Freshness(self, Freshness): self._Freshness = Freshness @property def Deeplinks(self): r"""

返回附件子链信息(仅旗舰版支持该参数)

附件子链信息包括"子链标题"和"子链URL",单个doc最多返回10条子链信息。

:rtype: bool """ return self._Deeplinks @Deeplinks.setter def Deeplinks(self, Deeplinks): self._Deeplinks = Deeplinks def _deserialize(self, params): self._Query = params.get("Query") self._Mode = params.get("Mode") self._Site = params.get("Site") self._Cnt = params.get("Cnt") self._Industry = params.get("Industry") self._Freshness = params.get("Freshness") self._Deeplinks = params.get("Deeplinks") memeber_set = set(params.keys()) for name, value in vars(self).items(): property_name = name[1:] if property_name in memeber_set: memeber_set.remove(property_name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(memeber_set)) class SearchProResponse(AbstractModel): r"""SearchPro返回参数结构体 """ def __init__(self): r""" :param _Query:

原始查询语

:type Query: str :param _Pages:

搜索结果页面详情,格式为json字符串。

:type Pages: list of str :param _Version:

用户版本:lite/standard/flagship(极速/标准/旗舰)

:type Version: str :param _Msg:

提示信息

:type Msg: str :param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self._Query = None self._Pages = None self._Version = None self._Msg = None self._RequestId = None @property def Query(self): r"""

原始查询语

:rtype: str """ return self._Query @Query.setter def Query(self, Query): self._Query = Query @property def Pages(self): r"""

搜索结果页面详情,格式为json字符串。

:rtype: list of str """ return self._Pages @Pages.setter def Pages(self, Pages): self._Pages = Pages @property def Version(self): r"""

用户版本:lite/standard/flagship(极速/标准/旗舰)

:rtype: str """ return self._Version @Version.setter def Version(self, Version): self._Version = Version @property def Msg(self): r"""

提示信息

:rtype: str """ return self._Msg @Msg.setter def Msg(self, Msg): self._Msg = Msg @property def RequestId(self): r"""唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 :rtype: str """ return self._RequestId @RequestId.setter def RequestId(self, RequestId): self._RequestId = RequestId def _deserialize(self, params): self._Query = params.get("Query") self._Pages = params.get("Pages") self._Version = params.get("Version") self._Msg = params.get("Msg") self._RequestId = params.get("RequestId")