---
title: "Configure an attribute for textual relevance"
slug: "configure-an-attribute-for-textual-relevance"
abstract: "Describes how to configure an attribute for textual relevance after initial setup."
---
# Configure an attribute for textual relevance

Textual relevance refers to how strong a potential match is compared to the visitor's search query. When you configure textual relevance, you tell Sitecore Search where in your content item it needs to look for matching terms and the relative importance it needs to give different content areas.

For example, you might want Search to look for search terms in the values of the *title* attribute, the *description* attribute, or somewhere else.

This walkthrough describes how to:

:::walkthrough
1. [Add a new attribute for textual relevance](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/configure-an-attribute-for-textual-relevance.html#add-a-new-attribute-for-textual-relevance)
2. [Configure textual relevance at the domain level](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/configure-an-attribute-for-textual-relevance.html#configure-textual-relevance-at-the-domain-level)
3. [Enable the attribute for textual relevance in the global widget](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/configure-an-attribute-for-textual-relevance.html#enable-the-attribute-for-textual-relevance-in-the-global-widget)
4. [Extract the new attribute](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/configure-an-attribute-for-textual-relevance.html#extract-the-new-attribute)
:::

## Add a new attribute for textual relevance

To add an attribute and enable it for textual relevance:

1. On the menu bar, click **Administration** > **Domain Settings**.
2. Click **Attributes** > **Add Attribute**.
3. In the attribute editing dialog, click **Settings** > **Entity** and then click the entity that this attribute applies to. Available entity options depend on your specific implementation.
4. In the **Display Name** field, enter a display name for the attribute.

    For example, enter *Keywords*.

5. In the **Attribute Name** field, enter the attribute's key or property name. This value is used later in the [source configuration](https://doc.sitecore.com/search/en/users/search-user-guide/index-items/additional-configurations-and-settings/configuring-document-extractors.html "Configuring document extractors").

    For example, enter *keywords*.

6. In the **Placement** drop-down menu, click **Standard**.
7. In the **Data Type** drop-down menu, click the data type of the attribute.

    For example, click **Array of strings**.

8. Optionally, enter values in the following following input fields:

    **Default Value**, **Description**, and **Icon**.

9. On the **Use For Features** tab, select the **Textual relevance** option.
10. To add the new attribute, click **Save**. Then, click **Publish**. In the dialog box that opens, to confirm your changes, click **Publish** again.

## Configure textual relevance at the domain level

To configure textual relevance at the domain level:

1. On the menu bar, click **Administration** > **Domain Setting** > **Feature Configuration**.
2. Click **Textual Relevance** > **Add Attribute**![plus_add__purple.png](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/plus_add__purple.png).
3. In the selector that opens, click **Add** ![Plus_add__grey.png](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/Plus_add__grey.png) next to the attribute you want to use for textual relevance, and then click **Add**.

    > [!note]
    > Search adds the *Multi-Locale Standard Analyzer* by default. Optionally, you can select other [analyzers](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/types-of-analyzers.html "Types of analyzers").
    >
    > Textual relevance no longer supports the **Shingle Generator** and **Ngram Based Match** analyzers. If you require either of these analyzers for textual relevance, please contact Sitecore Support.

4. At the top-right of the page, click **Save**.

## Enable the attribute for textual relevance in the global widget

Now that you've configured the textual relevance feature, you'll need to enable this attribute in the global widget.

To enable the attribute for textual relevance in the global widget:

1. On the menu bar, click **Global Resources** > **Global Widget** > **Global Widget Settings** > **Textual Relevance**.
2. Click **Advanced Mode**.

    In the advanced mode, you can assign values for the weights of different attribute/analyzer combinations. In the basic mode, you can only use integers to do a simple ranking of attributes.

3. To include an attribute, click **Include**.
4. In the **WEIGHT** column, assign a weight to the attribute.

    For example, enter *3*.

    > [!note]
    > The value of **WEIGHT** is an arbitrary number. What matters is how it compares to the weights you give to other attributes.
    >
    > As a best practice, do not assign a single attribute a weight of more than 5 in order to avoid heavily skewing the algorithm towards that attribute.

5. Click **Save**.
6. Click **Publish**.

## Extract the new attribute

After you configure an attribute to be used for textual relevance, you'll need to extract values for the attribute in all [sources](https://doc.sitecore.com/search/en/users/search-user-guide/index-items.html "Index items") that this attribute applies to.

The process of extracting attribute values depends on the type of [source](https://doc.sitecore.com/search/en/users/search-user-guide/index-items.html "Index items") you configured and the type of original content you have. In this example, assume you have a [web crawler source](https://doc.sitecore.com/search/en/users/search-user-guide/index-items/configure-indexing/configure-a-web-crawler.html "Configure a web crawler") and want to use HTML meta tags to extract the attribute's value.

To extract the new attribute:

1. On the menu bar, click **Sources** and select the source you want to edit to extract values for the new attribute.
2. To get the latest attribute list, on the **Source Settings** page, click **reindex**.
3. To extract attribute values, click **Edit** ![pencil_grey.png](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/pencil_grey.png) next to **Attribute Extraction**.
4. On the **Attribute Extraction** page, click **Add Attribute** ![Plus_add__grey.png](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/Plus_add__grey.png).
5. In the attribute selector, click **Add** ![Plus_add__grey.png](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/Plus_add__grey.png) next to the attribute whose value you want to extract, and then click **Add** at the bottom.

    For example, click **author_name**.

6. Next to the attribute you want to configure, in the **Type** drop-down menu, click **Meta Tag**
7. In the **VALUE** field, enter the name of the meta tag or property tag you want to use.

    For example, if you enter *author*, Search first constructs this XPath expression: `//meta[@name='author']/@content`. If this expression gives a value, Search stops. If this expression does not give a value, Search then constructs this XPath expression: `//meta[@property='author']/@content`.

    - Search first constructs this XPath expression: `//meta[@name='author']/@content`. If this expression gives a value, Search stops.

        If this expression does not give a value,

    - Search then constructs this XPath expression: `//meta[@property='author']/@content`.
8. Click **Save**.

## Verify your configuration

Now that you've extracted attribute values, we recommend that you verify your source configuration.