gpt4 book ai didi

google-custom-search - 使用多个搜索标签的谷歌自定义搜索 - 改进?

转载 作者:行者123 更新时间:2023-12-04 03:42:46 24 4
gpt4 key购买 nike

使用谷歌自定义搜索,可以使用 more: 运算符将结果优化为标签,如下所示:

searchterm more:blog

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

searchterm more:blog,articles

.. 但它似乎没有 - 相反,它被忽略了,就好像我指定了一个无效标签一样。

最佳答案

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

首先,Google Custom search documentation on search refinement never provides a query string example .另外,custom search is performed via APIs and XML requests not via a straight query .

其次,详细说明(下面的示例)如何自定义 Google 查询字符串的网站不包含带有 more: 标记的示例。所以,我认为不可能使用 more: 运算符创建标签。

来自 Automatic refinements 的另一个发现.

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: 运算符,但只能引用您已经创建的标签。


更新

此外,我建议使用 Google 的网站来 Test and troubleshoot your Linked CSE .你可以define your own context for a search engine并完成您的要求。

<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 有一个向导来帮助创建和自定义搜索
  • Google Help articles › Learn more › Search results > Refinements
  • 来自 Developer's Guide: Getting Started页:

    Refinements

    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.

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

  • 如果您想通过 API 过滤结果,Programmer's Guide: Filtering and sorting search results拥有您需要的一切。

关于google-custom-search - 使用多个搜索标签的谷歌自定义搜索 - 改进?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13690014/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com