You can define fields with custom names and values using meta tags on your web pages. Our API returns the names and values of the custom fields in search results, and you can filter the search results using them.

For instance, an artist has records in different genres. With custom fields, you can define a custom field for the artist with the artist name, records with the record names, and genres with the genre names.

Instructions

To define custom fields on a web page, use addsearch-custom-field meta tag as follows:

<html>
  <head>
    <meta name="description" content="This is a test page"/>
    <meta name="addsearch-custom-field" content="city=London"/>
    <meta name="addsearch-custom-field" content="genre=rock;genre=pop"/>
    <meta name="addsearch-custom-field" content="genre=hiphop"/>
  </head>
  <body>
    Lorem ipsum
  </body>
</html>

You can assign multiple values to a single custom field name. Add multiple values to separate meta tags or combine multiple values by separating them with a semicolon.

Search results can be filtered against custom fields in the Search API and Separate results page.