Google自定义搜索结果仅包含Google地图

时间:2017-11-13 04:02:36

标签: android google-custom-search

我最近实施了Google自定义搜索。我得到了一个结果,但无论是网站,图片还是缩略图,都是它的每一个链接,都是来自地图。

示例结果 -

 {
   "kind": "customsearch#result",

   "title": "Saga Tree",

   "htmlTitle": "Saga \u003cb\u003eTree\u003c/b\u003e",

   "link": "https://***www.google.com/mymaps***/viewer?mid=1yF1gMCZhBaeEouT9GB-7bQqXmuw&hl=en",

   "formattedUrl": "***https://www.google.com/mymaps***/viewer?mid...7bQqXmuw&hl...",

   "pagemap": {

      "cse_thumbnail": [
         {
          "width": "221",
          "height": "228",

          "src": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR2SZoZ2AF7PUVw5wGucLb5Hd4k1Bwkt3x6__ed8E_01Mlq5Fwd7nKpKI2b"
         }
    ],
    "website": [
         {
          "name": "Saga Tree",
          "description": "Saga Tree",
          "url": "***https://www.google.com/maps/d/viewer***?mid=1yF1gMCZhBaeEouT9GB-7bQqXmuw&hl=en",

          "image": "***https://www.google.com/maps***/d/thumbnail?mid=1yF1gMCZhBaeEouT9GB-7bQqXmuw&hl=en"

         }
    ],
    "metatags": [
         {
          "viewport": "initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0,width=device-width",
          "og:type": "website",
          "og:title": "Saga Tree",
          "og:description": "Saga Tree",
          "og:url": "***https://www.google.com/maps***/d/viewer?mid=1yF1gMCZhBaeEouT9GB-7bQqXmuw&hl=en",

          "og:image": "***https://www.google.com/maps***/d/thumbnail?mid=1yF1gMCZhBaeEouT9GB-7bQqXmuw&hl=en",

          "twitter:card": "summary_large_image",
          "twitter:title": "Saga Tree",
          "twitter:description": "Saga Tree",

          "twitter:image:src": "https://www.google.com/maps/d/thumbnail?mid=1yF1gMCZhBaeEouT9GB-7bQqXmuw&hl=en"

         }
    ],
    "cse_image": [
         {

          "src": "https://www.google.com/maps/d/thumbnail?mid=1yF1gMCZhBaeEouT9GB-7bQqXmuw&hl=en"

         }
    ]
   }
 }

每个结果都是如此。我想要结果,就像我在浏览器中搜索过一样。

1 个答案:

答案 0 :(得分:2)

这通常发生在自定义搜索API仅使用默认包含的网站(www.google.com)执行搜索时。这是默认值。要更改它,请转到基础 - >您的自定义搜索引擎下的搜索网站,然后选择" 搜索整个网络,但强调所包含的网站"而不是默认"仅搜索包含的网站"。

同时确保在Basics下启用图片搜索

alt text