Search Fields Weighting

Weighting is a feature in ElasticProbe that allows you to control how much influence different fields or attributes (like title, tags, categories, or content) have on a document’s relevance score during a search.

When a user performs a search, Elasticsearch assigns a relevance score to each piece of content it finds. This score determines the order in which results appear—higher scores mean more relevant matches. By using the weighting feature, you can fine-tune these scores by assigning more weight to certain fields that are more important in your context.

For example, you might decide that matches in the post title are more important than matches in the content body. You could apply a higher weight to the title field (e.g., 3x) and a lower weight to the content field (e.g., 1x). This ensures that posts with search terms in their titles appear higher in the search results than those that only mention the term in the body.

Enabling time based weighting in the plugin

  • Log into your WordPress admin area (e.g., https://yourdomain.tld/wp-admin).
  • Locate ElasticProbe in your list of installed plugins from the sidebar and click on it.
  • Navigate to the Post Search and enable it.
  • Using Weighting feature (marked as 2 in the image) you could give newer posts higher visibility in search results. Choose your preferred weighting option.
  • Click Save changes to apply.
  • To learn more about weighting based on fields other than date, continue reading this document.

Configuring search fields and weighting

  • Log into your WordPress admin area (e.g., https://yourdomain.com/wp-admin).
  • Locate the ElasticProbe plugin in sidebar
  • Click on Search Fields & Weighting.

You could configure the weight of different fields of Posts, Pages, Floating Elements and Products that are indexed by ElasticProbe. This allows you to control how much each field influences the search relevance score, by setting different Weight to them, helping to prioritize the most important content in your search results.

Bellow is the image of Products fields weighting under Search Fields & Weighting menu.

Note 1: If you don’t want a field to be included in search results, uncheck its Searchable box.

Note 2: Be sure to click Save Changes button after making any adjustments.

Note 3: You can also add your own custom fields and assign weights to them under the Metadata section.

By setting the Weight you can control how much influence a specific field has on the search ranking. This means you can prioritize certain types of matches—like those found in titles—over others, such as those found in the body text or tags.

For instance, imagine you run an online bookstore. If a user searches for “mystery,” you probably want the book titled The Mystery of Hollow Creek to appear above another book that only mentions the word “mystery” once in the description.

To achieve this, you can increase the value of the Weight slider for the Title field and then click Save Changes. This tells ElasticProbe to treat title matches as more important when calculating relevance, helping the most relevant content show up higher in the search results.

Assigning a weight of 2 to a field means it’s considered twice as important as a field with a weight of 1. However, this doesn’t directly double a document’s relevance score. Weight is just one factor in the overall calculation, and the scores are normalized, so think of weight as indicating relative importance compared to other fields.

Let’s revisit our online bookstore example: If all fields are weighted equally, a book that merely mentions the word “mystery” once in its description (The Weekend Escape) might get a higher relevance score than The Mystery of Hollow Creek, even though the latter has the keyword in the title. That’s because the match happens in different fields with the same weight.

To fix this, you could increase the weight of the Title field to 2. Now, when a user searches for “mystery,” the score for The Weekend Escape stays the same—since its title doesn’t include the word—but The Mystery of Hollow Creek gets a much higher relevance score and moves to the top of the results.

For optimal results, experiment with different field weights until the search results reflect your desired relevance and ranking.