# -*- 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。(极速版不支持该参数)
枚举值:
注:旗舰版在此模式下会额外返回一部分不影响接口耗时的“优质权威垂直信源”结果。指定网址搜索/过滤。
注意: 该参数与mode参数共同使用时,仅对公开网页信源结果(自然结果)生效,对优质权威垂直信源结果(VR卡)不生效。
:type Site: str :param _Cnt:控制返回结果条数,可取值:cnt=10/20/30/40/50。(极速版不支持该参数)
枚举值:
垂直领域搜索。(极速版不支持该参数)
枚举值:
搜索时效范围,以下五种入参形态不支持混合使用。
d[N]:最近N天,N取值1-30整数,N值为空时默认N=1。
m[N]:最近N月,N取值1-12整数,N值为空时默认N=1。
y[N]:最近N年,N取值1-5整数,N值为空时默认N=1。
yyyy-mm-dd:指定某一日。(不得早于1970-01-01,不得晚于请求当天日期)
yyyy-mm-dd,yyyy-mm-dd:从日期A至日期B,包含AB。(日期B不得晚于日期A;二者均不得早于1970-01-01,不得晚于请求当天日期)
示例:2026.6.15分别传参d2/m2/y2进行搜索,则搜索结果的时间范围分别为“2026.6.15、2026.6.14”/“2026.6、2026.5”/“2026、2025”,以此类推。
枚举值:
返回附件子链信息(仅旗舰版支持该参数)
附件子链信息包括"子链标题"和"子链URL",单个doc最多返回10条子链信息。
搜索词
:rtype: str """ return self._Query @Query.setter def Query(self, Query): self._Query = Query @property def Mode(self): r"""返回结果类型,不传默认为0。(极速版不支持该参数)
枚举值:
注:旗舰版在此模式下会额外返回一部分不影响接口耗时的“优质权威垂直信源”结果。指定网址搜索/过滤。
注意: 该参数与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。(极速版不支持该参数)
枚举值:
垂直领域搜索。(极速版不支持该参数)
枚举值:
搜索时效范围,以下五种入参形态不支持混合使用。
d[N]:最近N天,N取值1-30整数,N值为空时默认N=1。
m[N]:最近N月,N取值1-12整数,N值为空时默认N=1。
y[N]:最近N年,N取值1-5整数,N值为空时默认N=1。
yyyy-mm-dd:指定某一日。(不得早于1970-01-01,不得晚于请求当天日期)
yyyy-mm-dd,yyyy-mm-dd:从日期A至日期B,包含AB。(日期B不得晚于日期A;二者均不得早于1970-01-01,不得晚于请求当天日期)
示例:2026.6.15分别传参d2/m2/y2进行搜索,则搜索结果的时间范围分别为“2026.6.15、2026.6.14”/“2026.6、2026.5”/“2026、2025”,以此类推。
枚举值:
返回附件子链信息(仅旗舰版支持该参数)
附件子链信息包括"子链标题"和"子链URL",单个doc最多返回10条子链信息。
原始查询语
:type Query: str :param _Pages:搜索结果页面详情,格式为json字符串。
title:结果标题
date:内容发布时间
url:内容发布源url
passage:标准摘要
content:动态摘要(极速版不返回该字段)
site:网站名称,部分不知名站点结果可能为空
score:相关性得分,取值0~1,越靠近1表示越相关(极速版不返回该字段)
authority_level:权威度得分,取值0~5,数值越大表示越权威(仅旗舰版返回该字段)
pics:图片列表,单个doc返回0~10条(极速版不返回该字段)
favicon:网站图标链接,部分不知名站点结果可能为空
deeplinks:附件子链信息,单个doc最多返回10条子链信息。(仅旗舰版返回该字段,通过Deeplinks入参控制)
用户版本: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字符串。
title:结果标题
date:内容发布时间
url:内容发布源url
passage:标准摘要
content:动态摘要(极速版不返回该字段)
site:网站名称,部分不知名站点结果可能为空
score:相关性得分,取值0~1,越靠近1表示越相关(极速版不返回该字段)
authority_level:权威度得分,取值0~5,数值越大表示越权威(仅旗舰版返回该字段)
pics:图片列表,单个doc返回0~10条(极速版不返回该字段)
favicon:网站图标链接,部分不知名站点结果可能为空
deeplinks:附件子链信息,单个doc最多返回10条子链信息。(仅旗舰版返回该字段,通过Deeplinks入参控制)
用户版本: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")