# Data Points

Data points are recurring pieces of structured information extracted from your website's content during indexing. Once defined, the SS360 crawler picks them up and transforms them into structured data you can use to:

* enrich search result snippets
* power filters
* add sorting options

For example, on a blog you might extract an author name and a publishing date. On an ecommerce site, you might extract price, brand, SKU, or stock quantity.

[Video: Creating Data Points](https://www.youtube.com/embed/uoDjcQujPTg)

![A today.com Health \&amp; Wellness article with the author name and publishing date circled below the headline](/assets/images/dl_images__xdata-points-01.jpg.pagespeed.ic.txiuqyu-e_-05bb27c99759503d0b1051afabf6383a.jpg)

When looking at today.com, for example, Health & Wellness posts always show the author and publishing date below the headline. With data points, you can extract this information from each article to generate richer result snippets — making it easy for users to see who wrote an article or to sort results by date.

![Search results for jimmy fallon with Author and Date in each snippet and a Publishing date option in the sorting menu](/assets/images/dl_images__xdata-points-04.jpg.pagespeed.ic.xz_bhg6jgw-cb568ea8c4f49360a544ad95be4af7c7.jpg)

***

## Set up a data point

Go to [Data Structuring → Data Points](https://app.sitesearch360.com/data-structuring/data-points) in the SS360 control panel and click **Add New Data Point**.

![Data Structuring, Data Points tab in the Control Panel, with the Add New Data Point button highlighted](/assets/images/image.1622472552637-c359b395d35397992f5ffd8bb51547df.png)

Fill out the template to configure your first data point. Your settings may look something like this:

![Data point](/assets/images/image.1622472729404-8f7914115a16cd5782c7328065d4f837.png)

### Data point types

You can define data points as one of four types:

* **Text** — displays information within each search result
* **Numeric** — displays information and can also be used as a sorting option (e.g. price, weight, quantity)
* **Date** — displays dates and can be used as a sorting option
* **Boolean** — represents true/false values

### Data point settings

| Setting              | Description                                                                                                                                                                                        |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name**             | The label shown next to the data point in search results.                                                                                                                                          |
| **Partial matching** | Makes the data point substring-searchable. When enabled, a query for `12345678` will match a product with SKU `EU12345678`. Useful for SKUs, article numbers, and frequently searched identifiers. |
| **XPath**            | A valid XPath expression pointing the crawler to the DOM element that contains the data point. Every matching element on your site will be extracted.                                              |
| **Unique**           | Limits extraction to the first node matched by the XPath. Enable this when a page contains multiple matching nodes but you only need the first value.                                              |

![Author data point](/assets/images/dl_images__xdata-points-05.jpg.pagespeed.ic.zll20ivccp-4a1541ed68e225cf6a965a8384633eb0.jpg)

Click **Save** after configuring each data point.

Re-index your entire site after adding or changing data points for the changes to take effect.

***

## Define a data point source

You can point the crawler to data using any of the following source types.

### XPath

If the data point exists in your page's HTML (visible or hidden), enter a valid XPath expression. Every DOM element matching the expression will be extracted.

The easiest way to find the right XPath is with the Chrome extension [XPath Helper](https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl?hl=en). For a deeper introduction, see [Working with XPaths](https://docs.sitesearch360.com/working-with-xpaths.md).

![XPath](/assets/images/img-0-b3d88cfb020a78f246d56817482465a9.png)

### URL pattern

To extract a segment of a page's URL as a data point, use a regular expression. For example:

```
https://mysite.com/([^/]+)/
```

This extracts the first matching group from the URL path.

![URL Pattern](/assets/images/image.1648822752081-daa7b087fde01af1e7ddf19086014df8.png)

### Linked data (JSON-LD)

If your site uses JSON-LD structured data, you can extract data points directly from it.

![JSON-LD](/assets/images/image.1648823963391-6636a53b96c054135305e6104749d633.png)

Select the condition type from the dropdown, or type your own if none of the options match your schema. To extract a top-level property such as SKU from a `Product` type:

![Linked Data](/assets/images/image.1648824038749-e1be0b4d49839bbbd98805282c904ecf.webp)

To extract a nested property — for example, the brand name `Canyon` from a `brand/name` path — use a slash-separated notation:

```
brand/name
```

![Linked data - nested property](/assets/images/image.1648824615295-d09a391f45487f92d101f271e9a9b739.png)

### PDF metadata

You can extract PDF metadata properties as data points with a single click. The following properties are supported:

* Author
* CreationDate
* Creator
* ModDate
* Producer
* Title

**Extraction Preview** is not available for PDF metadata. To test your configuration, manually index a single PDF file in the [Index](https://app.sitesearch360.com/data/list/content) section.

***

## Date data points

Date data points can be used for sorting. To extend the today.com example: to display the publishing date in search results and offer it as a sorting option, define two separate data points that both point to the same XPath.

![Date data point settings: name Publishing Date, Unique checked, a date display format and locale, and an XPath reading the article’s datePublished time element](/assets/images/publishing-date-data-point-4a65d087ad1c06ed281c1351987e4634.png)

The XPath points to the publishing date found in the top-right corner of each article, extracted from a schema.org meta attribute, for example `//time[@itemprop='datePublished']/@content`:

![Browser developer tools on a today.com article: the publishing date comes from a time element with a datePublished content attribute](/assets/images/dl_images__xdata-points-07.jpg.pagespeed.ic.hoe_vu8-np-5641dd1f77ddb7b380131ea306e202f2.jpg)

SS360 extracts this date twice and uses it in two ways:

1. **Sorting option** — configured as a numeric "Publishing date" data point with **Unique** selected, so only the first matching node is used.
2. **Snippet display** — configured to show the date below the Author data point in search results, also with **Unique** selected.

[Image: Sorting]

![Date data point](/assets/images/dl_images__xdata-points-09.png.pagespeed.ic.weof6rn3w3-a91606497e11c4e4144f6f50d910764f.png)

By defining two data points from the same XPath, you can simultaneously create a sorting option and enrich the search snippet.

Below the data points, the **Default Sorting** option lets you select "Publishing date" as the default sort order so the newest articles appear first.

***

## Numeric data points

Numeric data points work similarly to date data points and can be used for sorting. You can extract price, rating, dimensions, coordinates, or any other numeric value.

Numeric data points can also extract dates, but a dedicated Date type is available and preferred for that use case.

To define a data point for product price, point the XPath to the price element on a product page:

![price xpath found on a product page](/assets/images/img-1-06e4d742497550dea940e56778b4e2a8.png)

Because the data point type is numeric, non-numeric characters such as `$` are automatically stripped during extraction.

![add numeric data point](/assets/images/img-2-4bf94f0d7064c8b317dd3bac0065cd0a.png)

The result: a single data point used in the search snippet, as the basis for a Price filter, and as a sorting option — all at once:

![price data point used in the result snippet as well as the filter and the sorting order](/assets/images/img-3-388619f06b7d2a3147a96d5fe46a4174.png)

***

## When to deselect "Unique"

By default, **Unique** limits extraction to the first matching node. Deselect it when you want to extract multiple values from a single page — for example, an ingredient list where each ingredient is a separate node.

On today.com's Food category, each recipe page contains a full ingredient list:

![A today.com recipe page with its ingredient list highlighted](/assets/images/dl_images__xdata-points-10.jpg.pagespeed.ic.gqkvzliokc-6dc67d5c28d1905d00514ec94e26eaaa.jpg)

Each data point consists of a name — "Ingredients" in this case — and an XPath pointing to the ingredient list. With **Unique** deselected, every ingredient node is captured.

![Add Data Point form: a Text data point named Ingredients, Unique unchecked, with an XPath pointing to the recipe ingredient list](/assets/images/image.1622473943044-76e2579c6d86016c9796b1fd37880c1c.png)

When a user searches for a recipe like "Z'paghetti Bolognese", the ingredients appear directly in the search result:

![Search result for Z’paghetti Bolognese with the full ingredient list shown in the snippet](/assets/images/dl_images__xdata-points-13.png.pagespeed.ic.n8x0yozwk9-d2049b9406399e24860a1be03e984706.png)

You can also place hidden elements on your pages — tables or other markup not visible to users — to hold structured data that the crawler can extract and include in search results.

Re-index your entire site after making changes to let them take effect.

***

## Result group data points

Data points can be used for result grouping. Previously created data points are available when configuring a result group, or you can enter an XPath or URL pattern while creating a new group.

![Create Result Group form: a group named Recipes, shown in search results, with the Ingredients data point added](/assets/images/image.1622478539643-6614a23e8865066b89344b05f0186cb0.png)

For a full walkthrough, see the [result group tutorial](https://sitesearch360.com/docs/content-groups).

***

## Show data points in search suggestions

To display data points inside search suggestions, add a `dataPoints` array to the relevant content block in `ss360Config`:

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

The `key` value must exactly match the data point name as defined in the control panel. Data points are displayed in the order they appear in the `dataPoints` array.

To see this in action, try searching for *granola* on the [Search Suggestions demo](https://docs.sitesearch360.com/search-suggestions.md) — the "Cost" and "Prep Time" data points are displayed in the suggestions.

### Display types

| Type    | Behaviour                                         |
| ------- | ------------------------------------------------- |
| `value` | Displays the data point value as plain text       |
| `chip`  | Displays the data point value as a chip           |
| `kv`    | Displays both key and value, e.g. **Protein:** 3g |

Using an older version of Site Search 360 (v13 and earlier)?

The `dataPoints` parameter is not available in v13 and earlier. Use the deprecated `extraHtml` parameter instead:

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

Upgrade to a current version to use `dataPoints`.

***

## Send data points via the API

When you index a page through the [REST API](https://docs.sitesearch360.com/api.md), send its data points in a `dataPoints` array. Each entry takes the data point's name as `key` and the page's value as `value`; add `"show": true` to display it in the result snippet:

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

For example, a page with an Author and a Publishing Date would include two objects in `dataPoints` — one for each data point.
