使用多个搜索标签的Google自定义搜索-完善吗? [英] Google custom search using multiple search labels - refinements?

查看:117
本文介绍了使用多个搜索标签的Google自定义搜索-完善吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google自定义搜索,可以使用more:运算符将结果精炼为标签:

With google custom search, one can refine results to a label by using the more: operator like so:

searchterm more:blog

但是如何将结果限制为多个标签呢?看来这应该工作:

But how can one restrict results to more than one label? It seems like this should work:

searchterm more:blog,articles

..但它似乎没有-而是像我指定了无效标签一样被忽略了.

.. but it does not appear to - instead it is ignored as if I had specified an invalid label.

推荐答案

根据我的研究,由于以下原因,您不能在Google查询字符串中使用more:运算符:

Based on my research, you cannot use the more: operator in a Google query string for the following reasons:

首先,有关搜索优化的Google自定义搜索文档从不提供查询字符串示例.另外,自定义搜索是通过API和XML请求而不是直接查询来执行的.

第二,详细介绍如何自定义Google查询字符串的网站(以下示例)不包含带有more:标记的示例.因此,我认为无法使用more:运算符创建标签.

Secondly, sites that detail (examples below) how to customize a Google query string don't contain examples with the more: tag. So, I don't think it's possible to create labels using the more: operator.

  • http://jwebnet.net/advancedgooglesearch.html
  • http://www.blueglass.com/blog/google-search-url-parameters-query-string-anatomy/
  • http://en.wikipedia.org/wiki/Google_Search#Search_options
  • http://support.google.com/websearch/bin/answer.py?hl=en&p=adv_operators&answer=136861

自动优化中的另一个发现.

您的第二个选择是添加more:运算符(随后是 标签名称)自动触发您用户的查询以触发 您的标签之一.您可以通过以下方式更改搜索表单: 哪些用户提交了他们的查询.

Your second option is to append the more: operator (followed by the label name) automatically to your users' queries in order to trigger one of your labels. You can do this by altering the search form from which users submit their queries.

因此,可以使用more:运算符,但只能引用您已经创建的标签.

So, the use of the more: operator is possible but only referencing labels you have already created.

更新

此外,我建议您使用Google的网站测试和解决链接的自定义搜索引擎.您可以为搜索引擎定义自己的上下文并完成您的要求.

Also, I recommend using Google's site to Test and troubleshoot your Linked CSE. You can define your own context for a search engine and accomplish your requirements.

<Facet>
    <FacetItem title="Blogs">
        <Label name="more:blog" mode="FILTER" weight="0.8">
        </Label>
    </FacetItem>
</Facet>
<Facet>
    <FacetItem title="Articles">
        <Label name="more:articles" mode="FILTER" weight="0.8">
        </Label>
    </FacetItem>
</Facet>

还有更多资源:

  • http://www.google.com/cse/ - Google has a wizard to help create and customize the search
  • Google Help articles › Learn more › Search results > Refinements
  • From the Developer's Guide: Getting Started page:

精炼

精炼是一种按主题对网站进行分类的方法.为了 例如,如果您有骑自行车的搜索引擎,则可以 自行车维护,自行车评论,自行车商店等类别, 自行车技巧等等.您可以创建细化 与您在网站"标签中列出的网站相关联的标签. 优化链接显示在搜索结果页面的顶部, 用户可以单击它们来缩小搜索范围.搜索页面 最多可以有16个优化链接.

Refinements are a way for you to categorize sites by topics. For example, if you have a bicycling search engine, you can have categories of, say, bike maintenance, bike reviews, bike stores, biking skills, and so on and so forth. You can create refinement labels that you associate with the sites you listed in the Sites tab. The refinement links appear at the top of your search results page, and users can click them to narrow down their searches. A search page can have as many as 16 refinement links.

要创建优化标签,请点击添加优化,然后定义 设置.要用标签标记网站,请转到网站"标签,然后选择 站点旁边的复选框,然后从标签中选择标签 操作下拉列表.您可以使用多个标签标记网站.

To create a refinement label, click Add Refinement, and define the settings. To tag websites with labels, go to the Sites tab, select check boxes next to the sites, and select the label from the Label actions drop-down list. You can tag sites with more than one label.

在创建标签之前,您可能需要检出现有 标签并与Google和其他用户共享资源.

Before you create your labels, you might want to check out existing labels and pool your resources with Google and other users.

  • 如果要通过API过滤结果,请《程序员指南:过滤和排序》搜索结果满足您的所有需求.
  • If you want to filter the results via the API, the Programmer's Guide: Filtering and sorting search results has everything you need.
  • 这篇关于使用多个搜索标签的Google自定义搜索-完善吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆