Dashboard Indexing

AddSearch excludes elements from the index by default to make the search results more relevant. For instance, AddSearch excludes sidebars, headers, and footers that rarely contain relevant content. The content of the elements may also be the same on all pages, which is not optimal in terms of providing relevant search results.

The text extraction rules allow you to include elements in the index that AddSearch excludes by default. The inclusion is useful if, for instance, you have a sidebar or other excluded element that contains crucial information associated with the rest of the page contents.

You can use the text extraction rules also to exclude elements from the index you don’t want to add to the search. For instance, your pages may have a cookie consent view or a newsletter popup that appears after the page is loaded. In addition to the unwanted contents, the elements may also appear in the screen captures displayed in the Widget view.

Instructions

You can include or exclude elements with these three steps:

  1. Find the selector of the element you want to include or exclude
  2. Create the text extraction rule for the element with the selector
  3. Recrawl to update the changes to the index

In the following sections, we will show you two examples of finding selectors for including and excluding the elements. Please note that in this guide, we have used Google Chrome to find the selectors for the elements. Finding the selectors may differ on other browsers.

For more information on the CSS selectors please visit w3schools.org

We will use one of our REST API reference page as an example to find a selector of the sidebar to include the contents using the text extraction rule.

Picture of a side bar element.

To find the selector follow these instructions:

  1. Open your browser and the REST API reference page
  2. Click Settings from the hamburger menu on the top right of the browser
  3. Click More tools
  4. Click Developer tools

The Developers tool opens.

  1. Click on the Arrow icon on the top left of the Developer tools view

Picture of Google Chrome developer tools UI.

  1. Move your mouse cursor on top of the element on the page

Side bar info box element selected with Google Chrome developer tools inspector.

You can see the name of the element in the popup: div.sidebard-info-box. You can use it as the text extraction rule in the AddSearch dashboard.

We will use the cookie consent popup from the AddSearch main page as an example to create the text extraction exclusion rule.

Picture of cookie consent element.

To find the selector follow these instructions:

  1. Open your browser and the AddSearch main page
  2. Click Settings from the hamburger menu on the top right of the browser
  3. Click More tools
  4. Click Developer tools

The Developers tool opens.

  1. Click on the Arrow icon on the top left of the Developer tools view

Picture of Google Chrome developer tools UI.

  1. Move your mouse cursor on top of the element on the page

Picture of cookie consent element selected with Google Chrome developer tools inspector.

You can see the name of the element in the popup: div.addsearch.cookie-consent. You can use it as the text extraction rule in the AddSearch dashboard.

Setting the text extraction rules in the AddSearch dashboard

After finding the selectors for the sidebar infobox and the cookie consent follow the instructions to set text extraction rules for them:

  1. Log in to your AddSearch Account
  2. Go to Text extraction rules under Domains and crawling
  3. Click Add new text extraction rule + button to add a new rule
  4. Copy the selector of the sidebar info box to the input field
  5. Select Include from the dropdown menu on the right of the input field
  6. Click Add new text extraction rule + button to a add new rule
  7. Copy the selector of the cookie consent to the input field
  8. Select Exclude from the dropdown menu on the right of the input field
  9. Click the Save to submit changes

Picture of text extractor rules tool UI in the AddSearch dashboard.

Recrawling

After making changes, a recrawl is required to update the index. You can either recrawl a single page or all the pages from your website.

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.