search mobile facets autocomplete spellcheck crawler rankings weights synonyms analytics engage api customize documentation install setup technology content domains user history info home business cart chart contact email activate analyticsalt analytics autocomplete cart contact content crawling custom documentation domains email engage faceted history info install mobile person querybuilder search setup spellcheck synonyms weights engage_search_term engage_related_content engage_next_results engage_personalized_results engage_recent_results success add arrow-down arrow-left arrow-right arrow-up caret-down caret-left caret-right caret-up check close content conversions-small conversions details edit grid help small-info error live magento minus move photo pin plus preview refresh search settings small-home stat subtract text trash unpin wordpress x alert case_deflection
Swiftype Documentation / crawler: Meta Tags

Swiftype-specific Meta Tags

The Swiftype web crawler supports a very flexible set of <meta> tags that allow you to deliver structured information to our web crawler. When our crawler visits your webpage, by default, we extract a standard set of fields (e.g. title, body) that are then indexed for searching in your search engine. With these <meta> tags you can augment -- or completely alter -- the set of fields our crawler extracts in order to better fit the data you wish to be indexed on your website.

Meta Tags

Each field we extract must meet specific structure guidelines, with defined name, type, and content values. The field type, which is specified in the data-type attribute, must be a valid, Swiftype-supported field type, which you may read about here.

The template for a Swiftype-specific Meta Tag is as follows, and should be placed within the <head> of your webpage:

<meta class="swiftype" name="[field name]" data-type="[field type]" content="[field content]" />

This is a more complex example, showing the creation of multiple fields. As you can see, the tag field is repeated, and as a result our crawler extracts an array of tags for this URL. All field types can be extracted as arrays.

<head>
  <title>page title | website name</title>
  <meta class="swiftype" name="title" data-type="string" content="page title" />
  <meta class="swiftype" name="body" data-type="text" content="this is the body content" />
  <meta class="swiftype" name="url" data-type="enum" content="http://www.swiftype.com" />
  <meta class="swiftype" name="price" data-type="float" content="3.99" />
  <meta class="swiftype" name="quantity" data-type="integer" content="12" />
  <meta class="swiftype" name="published_at" data-type="date" content="2013-10-31" />
  <meta class="swiftype" name="store_location" data-type="location" content="20,-10" />
  <meta class="swiftype" name="tags" data-type="string" content="tag1" />
  <meta class="swiftype" name="tags" data-type="string" content="tag2" />
</head>

Body-embedded Data Attribute Tags

If you don't want to repeat tons of text in the <head> of your page then you can just add data attributes to existing elements.

<body>
  <h1 data-swiftype-name="title" data-swiftype-type="string">title here</h1>
  <div data-swiftype-name="body" data-swiftype-type="text">
    Lots of body content goes here...
    Other content goes here too, and can be of any type, like a price:
    $<span data-swiftype-name="price" data-swiftype-type="float">3.99</span>
  </div>
</body>

Upgrade your old Meta Tags

When Swiftype originally launched we supported a small set of meta tags that were intended for very specific use-cases. We will continue to support those tags if you already have them on your website, but we do not recommend using them for new projects, and would be glad to see you upgrade (instructions below) them to the new style described above. You can read the original documentation here.

For each original-style meta tag, simply replace the tag with an equivalent tag using the new format. In each example below the first line shows an example original-style tag, and the second line shows the correct replacement.

st:title
<!-- old, deprecated style -->
<meta property='st:title' content='[title value]' />

<!-- new, correct style -->
<meta class='swiftype' name='title' data-type='string' content='[title value]' />
st:section
<!-- old, deprecated style -->
<meta property='st:section' content='[section value]' />

<!-- new, correct style -->
<meta class='swiftype' name='sections' data-type='string' content='[sections field value]' />
st:image
<!-- old, deprecated style -->
<meta property='st:image' content='[image url]' />

<!-- new, correct style -->
<meta class='swiftype' name='image' data-type='enum' content='[image url]' />
st:type
<!-- old, deprecated style -->
<meta property='st:type' content='[type value]' />

<!-- new, correct style -->
<meta class='swiftype' name='type' data-type='enum' content='[type value]' />
st:info
<!-- old, deprecated style -->
<meta property='st:info' content='[info value]' />

<!-- new, correct style -->
<meta class='swiftype' name='info' data-type='string' content='[info value]' />
st:published_at
<!-- old, deprecated style -->
<meta property='st:published_at' content='[published_at date]' />

<!-- new, correct style -->
<meta class='swiftype' name='published_at' data-type='date' content='[published_at date]' />
st:popularity
<!-- old, deprecated style -->
<meta property='st:popularity' content='[popularity value]' />

<!-- new, correct style -->
<meta class='swiftype' name='popularity' data-type='integer' content='[popularity value]' />

Additional Help

If you need additional help or have any questions about how to upgrade you meta tags, please contact support@swiftype.com