Search code examples
google-custom-searchrich-snippetsrdfa

RDFa reference documents


I have to implement a Google Custom Search for a website. The website has different content types. One of them is a "publication". A publication consists of different fields:

  • Title
  • Author
  • Published date
  • Document
  • Document type

Document is the URL to a PDF, Text, MS-Word, etc. document. And Document type is, as you can expect, the document type (ie. PDF, DOC, TXT, etc).

I will need this information to be in the Rich Snippet because I have to format the search results differently for each document type (ie. include a different icon, etc).

What schema should I be using for that? I could not find information about how to structure data for that kind of content. Can I use anything from Schema.org? Or should I create my own? Any idea?

Thanks in advance for any input on that.


Solution

  • For customizing results snippets in Google Custom Search, it doesn’t matter which vocabulary you use in your RDFa. You could use an existing one (like Schema.org), or create your own, or use any combination of multiple vocabularies.

    You can see the extracted structured data that can be used for this purpose in the Google Structured Data Testing Tool by clicking at "Custom Search Result Filters" (or by changing the results filter from "All data" to "Custom Search Engine").

    You can fetch this structured data and create your own presentation layer.