schema.org - PageMap 不包含在 Google 自定义搜索引擎的搜索结果中

标签 schema.org google-custom-search json-ld google-rich-snippets structured-data

我有一个自定义搜索引擎和我自己的 React 客户端,它使用 CSE json API 呈现搜索结果。我想使用结构化数据显示丰富的结果,因此我将 PageMap 添加到源 HTML 文件中。但 Google 的搜索结果不包含 PageMap 中的任何数据。

结构化数据通常用于过滤搜索结果。我在这里关心的是在自定义搜索结果中接收结构化数据的更简单的问题,因此我可以自己渲染它。

以下是来 self 的 CSE 中的一个网站的示例源 HTML 页面:

查看源代码:http://www.johndimm.com/eleventh-hour/papyritec/Humidity_control_tile.html

它的 header 中有一个 PageMap(还有使用 schema.org 的产品的 ld+json):

   <!--
  <PageMap>
     <DataObject type="document">
        <Attribute name="product_name">Humidity control tile</Attribute>
        <Attribute name="rating">4.0</Attribute>
        <Attribute name="description">With the integration of nanotechnology into the humble ceramic tile, we have a new generation of tiles to solve household problems. Our nanotech tiles can regulate humidity by absorbing excess moisture and storing it in the tiny pores; and by releasing moisture when the environment is dry. It also absorbs VOCs and air pollutants into the pores and catalyse reactions to break down toxicity in those gases. Due to its porosity, it is a fantastic insulator of both heat and sound. Think nano-tiles for your next renovation!</Attribute>
        <Attribute name="product_id">nanotile01</Attribute>
     </DataObject>
     <DataObject type="thumbnail">
        <Attribute name="src" value="nanotile01.jpg" />
        <Attribute name="width" value="300" />
     </DataObject>
  </PageMap>
  -->

尽管存在页面映射对象,但搜索结果未显示任何此信息:

https://www.googleapis.com/customsearch/v1?key=[cse键]&cx=010143774142193520043:z76tkkewcr9&q=papyritec%20humidity

页面 map 只有 cse_thumbnail 和 cse_image,我认为是 Google 添加的。

     "pagemap": {
        "cse_thumbnail": [
          {
            "src": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRtbYjjezl1LjCPxzWlcqP8qqUwOZ31ap1fvMz9w5tq1YYY8_pSL4ITR6E",
            "width": "203",
            "height": "249"
          }
        ],
        "cse_image": [
          {
            "src": "http://www.johndimm.com/eleventh-hour/papyritec/images/nanotile01.jpg"
          }
        ]
      }

问题:我做错了什么?这是包含 PageMap 的正确方法吗?我的页面 map 字段是否应该合并到每个结果项中的页面 map 对象中?

更多详细信息:

该页面的结构化数据测试工具找到ld+json,但没有找到PageMap:

https://search.google.com/structured-data/testing-tool/u/0/#url=www.johndimm.com%2Feleventh-hour%2Fpapyritec%2FHumidity_control_tile.html

富结果测试还显示 ld+json 数据,但不显示 PageMap。

https://search.google.com/test/rich-results?utm_source=support.google.com%2Fwebmasters%2F&utm_medium=referral&utm_campaign=7445569&id=3bPgmFzohazQyLMe2XJKJQ

这里有一篇文章显示了搜索结果中出现的自定义页面 map 。这是我希望看到的。它只是付费级别的功能吗?

Pagemap data and Google Structured Data Validator tool

Google 的这篇文章表示“请注意,目前 CSE 不支持 JSON-LD。”

https://support.google.com/customsearch/thread/12070581?hl=en

PageMap 似乎是结构化数据的首选方法。必须有某种方法让它发挥作用。

最佳答案

我不够耐心。 18 个 html 文件之一现在与我的大部分页面 map 数据一起显示在搜索结果中。它们都具有相同的格式,所以也许我只需要等待更多时间,让 Google 以相同的方式处理它们。

由于某种原因,其中一个字段仍然缺失。文档对象具有描述、评级和产品名称,但没有产品 ID。

但这回答了我的问题。此处描述的设置确实有效,并且传递的自定义页面 map 数据或多或少是搜索结果。

      "pagemap": {
        "thumbnail": [
          {
            "src": "Oryzasil.png",
            "width": "300"
          }
        ],
        "document": [
          {
            "rating": "4.0",
            "description": "Silicon based aerogel blanket. Super low thermal conductivity: 0.020 W/mK at 10mm. Comes in different thickness of 3mm, 5mm, and 10mm. Contact us for a product recommendation. Used predominantly in oil and gas industries.",
            "product_name": "Silicon hydrophobic aerogel"
          }
        ],
        "metatags": [
          {
            "viewport": "width=device-width, initial-scale=1.0, maximum-scale=1.0, \n  user-scalable=no"
          }
        ],
        "cse_image": [
          {
            "src": "http://www.johndimm.com/eleventh-hour/papyritec/images/Oryzasil.png",
            "width": "247",
            "type": "1",
            "height": "204"
          }
        ]
      }

关于schema.org - PageMap 不包含在 Google 自定义搜索引擎的搜索结果中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60479325/

相关文章:

java - 谷歌日历 API。处理事件的共享扩展属性

javascript - 在谷歌自定义搜索引擎 V2 代码中执行默认查询

flutter - 如何将JSON-LD转换为dart对象

arrays - JSON-LD 构建单个对象数组

microdata - 标记 "mainContentOfPage"的最佳方法?

xhtml - 在 xhtml 页面中使用 schema.org 标记和评论时,不显示星级和聚合评分

semantic-web - WPHeader 的 Schema.org 用法(或如何将结构化数据添加到 ‘Hero’ 图像

c# - 在电子邮件中添加了 Schema.org 标记,不会影响 Gmail 的收件箱,无论是在移动应用程序还是 Web 应用程序中

css - Google CSE 自定义搜索 CSS

JSON-LD无法在@context中定义多个节点类型