I want to enable Google Sitelinks Search Box for a website. The point is its custom search page is implemented by hash fragment so the JSON-LD data snippet is like this:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name" : "my site",
"alternateName" : "example.com",
"url": "http://www.example.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "http://www.example.com/Search/#!/Keyword-{search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
While Google tries to extract the information from this part "required name=search_term_string"
to show the sitelinks search box, encounter a problem:
: http://schema.org/True
valueName: missing and required
I suspect maybe Google just expect search string inside a query string instead of hash fragment, what do you recommend except redirecting?
Thanks to @unor I found the solution, so the final code is something like this: