Google improved search box within the search results not working

好久不见. 提交于 2019-12-01 08:15:45

问题


I follow Google’s tutorial for improved search box within the search results just like above screenshot.

I added this code in my front sitepage:

<script type="application/ld+json">
{
   "@context": "http://schema.org",
   "@type": "WebSite",
   "url": "https://www.xxx.com/",
   "potentialAction": {
   "@type": "SearchAction",
      "target": "https://www.xxx.com/search/site/{keys}",
      "query-input": "required name=keys"
    }
 }

 </script>

Am I doing something wrong? My site uses Drupal 7.


回答1:


Looks correct (assuming that /search/site/strawberry successfully searches for "strawberry").

Note that Google is not displaying the Sitelinks Search Box for all sites/queries:

Search box not displaying? The sitelinks search box appears only for navigational queries and when relevant for users. Google algorithms use a variety of factors to determine when the box appears, including the information on the site and different types of navigational queries from Search users.

Edit: 2017-05-09 Updated Sitelinks Search Box Information and URL



来源:https://stackoverflow.com/questions/26878983/google-improved-search-box-within-the-search-results-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!