Ad

Representing Search Results In JSON-LD

- 1 answer

I am uncertain how to represent search results in JSON-LD. e.g. for a page containing hotel search results, should each hotel be included in an array of LodgingBusiness entities in the emitted JSON-LD snippet.

Is this even desirable given that the search results are not static and will change based on e.g. availability, ordering or other factors?

Ad

Answer

Schema.org has "SearchResultsPage" for this. I would use it.

Check this example from search results in doctor directory at Google's Structure Data Testing Tool for microdata format as that will allow you to understand the structure.

In ItemList you may have any other types, and it will be easy to connect them using it.

I would say that search engines don't use this much right now, but in Google Search Console you will be able to use Data Highlighter then.

I converted a part into JSON-LD, so it should look like this:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "SearchResultsPage",
  "mainEntity": [{
    "@type": "ItemList",
    "name": "Primary Care Physicians Chicago, IL 60646",
    "itemListOrder": "http://schema.org/ItemListOrderAscending",
    "itemListElement":[{
        "@type": "ListItem",
        "position": 1,
        "item": {
            "@type": "Physician",
            "url": "https://healthjoy.com/doctor/bernadette-b-mayer/5365-w-devon-ave-chicago-il-60646/"
        }

    },
    {
        "@type": "ListItem",
        "position": 2,
        "item": {
            "@type": "Physician",
            "url": "https://healthjoy.com/doctor/vaidotas-petrus/6225-w-touhy-ave-chicago-il-60646/"
        }
    }]
  }]
}
</script>
Ad
source: stackoverflow.com
Ad