在自定义搜索中分类和筛选结果
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
2012年7月17日星期二
发表者:
Roger Wang
,软件工程师
原文:
Sorting and Filtering Results in Custom Search
通过
自定义搜索引擎
(CSE),您可以创建丰富的搜索体验,使访问者在您的网站上更容易找到所需信息。最近,我们发布了两项改进,以便在CSE 中分类和过滤搜索结果。
第一,CSE 目前支持基于UI的
结果排序
,您可以在CSE 控制面板的基础选项卡中启用。当您在网站中更新CSE 单元码后,搜索结果的顶部会出现一个“按类别划分”选择器。
在默认状态下,CSE 支持按日期和相关性分类。在控制面板中,您可以指定其他基于网站内容结构的“按类别划分”按键,为用户提供了更多的选项,以寻找与其最具相关性的搜索结果。例如,如果您标记了
产品丰富网页摘要
页面,则可以根据价格进行分类,如下所示:
第二,我们推出了简洁查询,以便
按属性筛选
。例如,现在您可以开始一项查询:
[more:pagemap:product-description:search more:pagemap:product-description:engine]
查询结果中将仅显示在产品描述属性中同时包含“search”和“engine”的页面。
通过简洁查询,您可以发出如下请求:
[more:p:product-description:search*engine]
我们希望这些新功能可以帮助您为访问者创建更丰富、更实用的搜索体验。和往常一样,如果您有任何疑问或反馈,请通过
帮助论坛
与我们联系。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2012-07-01。
[null,null,["最后更新时间 (UTC):2012-07-01。"],[[["\u003cp\u003eCustom Search Engine (CSE) now offers UI-based results sorting, allowing users to sort by relevance, date, or custom attributes like price.\u003c/p\u003e\n"],["\u003cp\u003eCSE introduces compact queries for filtering by attribute, simplifying the syntax for searching specific content within structured data.\u003c/p\u003e\n"],["\u003cp\u003eThese updates aim to enhance search experiences for website visitors by providing more control and flexibility in finding relevant information.\u003c/p\u003e\n"],["\u003cp\u003eSome information in this blog post may be outdated due to its age, including missing images or broken links.\u003c/p\u003e\n"]]],["Custom Search Engine (CSE) introduces two updates: UI-based results sorting and compact queries for filtering. Users can enable a \"sort by\" picker in the CSE control panel, allowing sorting by date, relevance, or custom keys, like price for product pages. Compact queries simplify attribute-based filtering, replacing verbose queries with a condensed format, such as `[more:p:product-description:search*engine]`. These features aim to enhance the user search experience. This information may be outdated.\n"],null,["# Sorting and Filtering Results in Custom Search\n\n| It's been a while since we published this blog post. Some of the information may be outdated (for example, some images may be missing, and some links may not work anymore).\n\nTuesday, May 08, 2012\n\n\n*(Cross-posted on the\n[Custom Search Blog](https://googlecustomsearch.blogspot.com/2012/05/sorting-and-filtering-results-in-custom.html))*\n\n\nUsing [Custom Search Engine](https://www.google.com/cse/) (CSE),\nyou can create rich search experiences that make it easier for visitors to find the information\nthey're looking for on your site. Today we're announcing two improvements to sorting and filtering\nof search results in CSE.\n\n\nFirst, CSE now supports UI-based\n[results sorting](https://support.google.com/customsearch/bin/answer.py?answer=2549537),\nwhich you can enable in the Basics tab of the CSE control panel. Once you've updated the CSE\nelement code on your site, a \"sort by\" picker will become visible at the top of the results\nsection.\n\n\nBy default CSE supports sorting by date and relevance. In the control panel, you can specify\nadditional \"sort by\" keys that are based on the structure of your site's content, giving users\nmore options to find the results that are most relevant to them. For example, if you've marked up\npages for [product rich snippets](/search/docs/appearance/structured-data/product), you\ncould enable sorting based on price as shown in this screenshot:\n\n\nSecond, we're introducing compact queries for\n[filtering by attribute](/custom-search/docs/structured_search#filter_by_attribute).\nCurrently you can issue a query like\n`[more:pagemap:product-description:search more:pagemap:product-description:engine]`\nwhich will only show pages with a `product-description` attribute that contains both\n`search` and `engine`.\n\n\nWith a compact query, you can issue the same request as\n`[more:p:product-description:search*engine]`\n\n\nWe hope these new features help you create richer and more useful search experiences for your\nvisitors. As always, if you have any questions or feedback please let us know via our\n[Help Forum](https://support.google.com/programmable-search/community).\n\n\nPosted by\n[Roger Wang](https://plus.google.com/109448640522131155324/about),\nSoftware Engineer"]]