首页 > 解决方案 > PageMap 不包含在 Google 自定义搜索引擎的搜索结果中

问题描述

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

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

这是来自我的 CSE 中的一个站点的示例源 HTML 页面:

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

它在标题中有一个 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>
  -->

搜索结果不显示这些信息,尽管有一个 pagemap 对象:

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

页面地图只有 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 的正确方法吗?我的页面地图字段是否应该已合并到每个结果项中的页面地图对象中?

更多细节:

此页面的结构化数据测试工具找到了 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

这是一篇显示搜索结果中出现的自定义页面地图的帖子。这是我希望看到的。它只是付费级别的功能吗?

页面地图数据和谷歌结构化数据验证工具

谷歌的这篇文章说“请注意,目前 CSE 不支持 JSON-LD。”

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

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

标签: schema.orggoogle-custom-searchjson-ldgoogle-rich-snippetsstructured-data

解决方案


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

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

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

      "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"
          }
        ]
      }

推荐阅读