Skip to main content

Data Points

Data points are pieces of information that Site Search 360 takes from each page when it indexes your site, such as an author, a publishing date or a price. You can show them in your search results, filter and sort by them, and use them to find pages.

An author search result with a Born date range filter, marked 1, and the author’s Born date below the snippet, marked 2

Here one Date data point, Born, is extracted from author pages. It powers a filter (1) and shows in each result (2).

Where to find it: Data Structuring → Data Points

Before you start: The place on your pages where the value sits, usually as an XPath; see Working with XPaths.


Create a data point​

  1. Click Add New Data Point at the top of the page.
  2. Choose the Data Type (which one) and enter a Data Point Name. Visitors see the name next to the value.
  3. Tell the crawler where to find the value. By default it's an XPath, for example //span[@class='author']; see Data sources for the other options.
  4. Under How Do You Want to Use This Data Point?, tick what it's for:
    • Improve Searching (Text only, on by default): pages are found and ranked higher when a search matches the value.
    • Make It Visible Within One or More Result Groups: shows the value in the results of the result groups you pick.
    • Create a New Filter: adds a filter on this data point.
    • Create a New Sorting Option (Number and Date): adds a sorting option.
  5. Under Extraction Preview, enter one of your URLs as Test URL and click Load to see the values it extracts.
  6. Click Add, then Save at the top of the page.
  7. Re-index your site. Data points are extracted during indexing, so new or changed data points show up only after a re-index.

You can change the filter and sorting option later under Filters and Sorting, and the data points a group shows under Result Groups.


Data types​

TypeUse it forExtra options
TextNames, categories, SKUsPartial Matching: adds the value to the page's searchable title, so a search for it, such as an article number, finds the page
NumberPrices, ratings, sizesBoosting: rank pages by the value under Page Boosting
DatePublishing or event datesDate Display Format and Locale for how dates look in results; Boosting
BooleanYes/no values, such as "in stock"Default Value, and the texts that count as True Values and False Values

Number and Date data points can be sorting options. For dates, use the Date type rather than Number. A Number data point drops characters such as $ and keeps the number.

Unique (Extract Only the First Value), off by default, keeps only the first value found on a page. Leave it off to extract several values.

The type can't be changed once a filter, sorting option or boosting uses the data point.


Data sources​

Choose a source for each data point. To read the value from more than one place, click Add Data Source.

XPath​

An XPath to the element that holds the value, visible or hidden. Every element it matches gives a value. The XPath Helper Chrome extension helps you find one; see Working with XPaths.

To read a value from an attribute, end the XPath with it, for example //time[@itemprop='datePublished']/@content.

URL Pattern​

A regular expression on the page URL. The first group in brackets is the value. For example, /shop/([^/]+)/ takes shoes from https://example.com/shop/shoes/sneaker-1.

Linked Data​

A value from the page's JSON-LD structured data. Set the Condition to the @type of the object, such as Product, and the Property Path to the property. For this JSON-LD:

<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": "Neuron CF 8 WMN",
"SKU": "3161",
"brand": { "@type": "Thing", "name": "Canyon" }
}
</script>
  • Condition Product, Property Path SKU gives 3161.
  • Condition Product, Property Path brand/name gives Canyon. Separate nested properties with a slash.

PDF Meta Data​

A field from the document information of your PDFs, such as Author, Title, CreationDate or Keywords. Enter the field name exactly as it's stored in the PDF. PDF dates are read correctly as the Date type.

Extraction Preview doesn't work for PDFs. To test, index a single PDF under Index and check its data points.

Content Regex​

A regular expression run on the page's HTML. Each match becomes a value. The value is the whole match, not only the group in brackets, so write the expression to match just the value you want, and check it in Extraction Preview.

API Based​

No extraction: the values come only from pages you send through the API.

Advanced Extraction Settings​

Open Advanced Extraction Settings under a source to clean up its values:

  • Delimiters: split one value into several, for example at a comma.
  • Postprocessing Regular Expression (XPath only): keep only the first group of the expression.
  • Replacement Rules: replace text in the value.
  • Extract Raw HTML (keeping tags) (XPath only): keep the HTML instead of the text.
  • Capitalization and Remove non-alphanumeric characters (Text only).

Examples​

A publishing date​

On a blog or news site, each article shows its publishing date. One Date data point shows it in the results and lets visitors sort by it, like Born in the image at the top of this page:

  1. Create a data point with Data Type Date and the name "Publishing Date".
  2. Tick Unique (Extract Only the First Value), so a page with several dates gives only the first.
  3. Point the XPath at the date, for example //time[@itemprop='datePublished']/@content.
  4. Choose a Date Display Format and Locale.
  5. Tick Make It Visible Within One or More Result Groups (pick your blog group) and Create a New Sorting Option.
  6. Click Add, Save, and re-index.

To show the newest articles first, choose "Publishing Date" as the Default Sorting Option under Filters and Sorting → Sorting.

A price​

Shop pages show a price with its currency, such as £51.77. A Number data point keeps only the number (51.77), which a price range filter and sorting need. To also show the currency in results, create two data points with the same XPath, for example //p[@class='price_color']:

  • A Text data point, "Price", with Make It Visible Within One or More Result Groups ticked: results show the price as written on the page.
  • A Number data point, "Price value", with Create a New Filter and Create a New Sorting Option ticked: visitors can filter by a price range and sort by price.

Tick Unique (Extract Only the First Value) on both, so a page that also lists related products gives only its own price. If results can show the number without the currency, one Number data point does all three.

After the re-index, adjust the filter under Filters and Sorting → Filters, and choose ascending or descending order for the sorting option under Sorting.

Several values from one page​

With Unique off, every element the XPath matches gives a value. For example, a recipe page lists each ingredient in its own element. A Text data point named "Ingredients" with this XPath takes all of them:

//div[@class='recipe-ingredients']/ul/li/ul/li

Once the data point is visible in the recipes' result group, each ingredient shows as its own value in the search result.

You can also add hidden elements to your pages, such as a table that visitors don't see, just to hold values for data points.


Table data points​

If your pages show data as a table of names and values, such as a product's specifications, use Table Data Points further down the page. Click Add New Data Point in that section and set:

  • Keys XPath: the cells with the names.
  • Values XPath: the cells with the values.
  • Optional: Row Wrap XPath for the element around each row.
  • Optional: a key or value regular expression to clean up the names or values.

Each name in the table becomes its own data point.


Show data points in search suggestions​

To show data points in search suggestions, add a dataPoints array to the suggestion block in your ss360Config:

var ss360Config = {
/*...*/
suggestions: {
source: {
queryBased: {
content: [{
type: 'resultGroup',
dataPoints: [
{ key: 'Cost', type: 'value' },
{ key: 'Calories', type: 'chip' },
{ key: 'Protein', type: 'kv' },
]
}]
}
}
}
}

key must match the Data Point Name exactly. Data points appear in the order of the array, in one of three styles:

TypeShows
valueThe value as plain text
chipThe value as a chip
kvThe name and the value, e.g. Protein: 3g

To see it, search for granola on the Search Suggestions demo: the suggestions show the "Cost" and "Prep Time" data points.

Using Site Search 360 v13 or earlier?

dataPoints isn't available before v14. Use the deprecated extraHtml parameter instead, or upgrade:

suggestions: {
extraHtml: '<b>Price</b>: #Price#'
}

Send data points through the API​

When you add a page with the REST API, send its data points in a dataPoints array. Each entry has the data point's name as key and the page's value as value. Add "show": true to show it in the result:

"dataPoints": [
{ "key": "Author", "value": "Jordan Muto", "show": true },
{ "key": "Publishing Date", "value": "2017-09-22", "show": true }
]