I want to enhance a search function's semantic meaning using JSON-LD.
The most popular snippet to do that seems to be this one from Google:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://www.example-petstore.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://query.example-petstore.com/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
While I understood how this works, I am wondering if it's possible to combine the SearchAction
markup with other parts of Schema.org's vocabulary.
For example when you can search for a hotel room to be available at a specific point in time, is it possible to embed this information using JSON-LD?
Let's say the search string looks like this: search-hotels-global.com/?s=new-york&start=5-5-15&end?19-5-15
, how do I implement it in JSON-LD, can I do it just like this?
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://www.example-petstore.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "search-hotels-global.com/?q={search_term_string}&start={start_date_input}&end={end_date_input",
"query-input": "required name=search_term_string",
"query-input": "name=start_date_input",
"query-input": "name=end_date_input",
}
}