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.

Please note that custom fields’ names may contain only the following characters: A-Z, a-z,_,-, and 0-9, and the maximum length of the custom field name is 256 characters.

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


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

    <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"/>
    <meta name="addsearch-custom-field" data-type="text" content="description=This is a rock/pop event taking place in London"/>
    <meta name="addsearch-custom-field" data-type="date" content="event_date=2019-11-19"/>
    <meta name="addsearch-custom-field" data-type="integer" content="price_cents=599"/>
    <meta name="addsearch-custom-field" data-type="double" content="average_review=4.3"/>
    Lorem ipsum

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.

Custom fields support the following data types:

  • keyword: Default data type. It cannot be searched but can be used as filters.
  • text: Can be both searched and used as filters.
  • integer: Can be used with range filters.
  • double: Use point as decimal separator. Example: “5.74”. It can be used with range filters.
  • date: Holds date, time and time zone. It should be in ISO 8601 format. The time part is optional.
    Examples: “2019-11-19T00:00:00.000Z”, “2019-11-19”. Can be used with range filters.

For a specific custom field name, the data type will be locked after the first time the field is encountered by our crawler. Because of this, the data type of a custom field cannot be changed once it has been defined. If you need to use another the data type, you also need to change the field’s name. A custom field meta tag with unrecognized data type value will be ignored.

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

Additional resources

Was this helpful?

Need more help?

We’re always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team.