Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
自定义搜索结果
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
与自定义搜索框类似,您也可以为搜索结果元素添加其他选项。
例如,要将我们的搜索引擎从基于网页搜索结果的
转换为基于图片,我们可以使用 defaultToImageSearch 属性。
首先,您需要在控制面板中为您的搜索引擎启用图片搜索。在设置部分的基本设置标签页中,点击图片搜索选项并进入“开启”状态排名。然后,将 defaultToImageSearch 属性添加到您网站上的 <div class="gcse-searchresults"></div> 元素中。
<!-- 在此插入您自己的可编程搜索引擎 ID -->
<script async src="https://cse.google.com/cse.js?cx=017643444788069204610:4gvhea_mvga"></script>
<!-- 尝试将属性值切换为“true”或“false”-->
<div class="gcse-searchbox"></div>
<div class="gcse-searchresults" data-defaultToImageSearch="true"></div>
现在,当您进行搜索时,系统会默认显示“图片搜索”标签页。
还有很多其他选项可供选择。如需了解其他搜索结果自定义选项,请参阅 Programmable Search Element Control API 部分。
下一个...
继续执行后续步骤。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-02-18。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-02-18。"],[],[]]