WPSOLR PRO + Advanced Scoring Extension + Elasticsearch
This video suppose you already have installed a local Elasticsearch.
You will see how to setup WPSOLR PRO to use advanced scoring methods with:
- The WPSOLR PRO Advanced Scoring extension
- Your local Elasticsearch
What is the “Advanced Scoring” extension ?
Every WooCommerce store owner wants to solve the “Freshness vs relevant” paradigm.
By default, results in a search are ordered by relevancy: the most relevant products related to the search keywords are displayed first.
But what if the most relevant products are also the oldest ? or the most expensive ? Showing older or more expensive products first is not good, everyone can agree on that.
Hey, but why not sort results by recent dates or lower prices ? Sure, it should solve the issue, no ?
Well, unfortunately, it would not. Because sorting is a very destructive option: it erases completely the results relevancy. Which means instead of getting old or expensive relevant results, you would get new or cheap not-so-relevant results.
The solution: decay scoring
Scoring is how search engines like Elasticsearch are sorting results by default. It gives a score, a number, to each documents in the index, relative to the search keywords.
When you set another sort, like date or price, you just give away the scoring.
The idea with decay scoring, used by the Advanced Scoring Extension, is to continue to use the score as the default sort. By modifying the scoring number with a function that includes a “decay“.
The “decay” being a distance calculated from a date or a number, like the posts publication date or the products price, or products stock quantity, or any other products promotional indicator.
See a detailed Elasticsearch decay function documentation
What is in the video ?
The video shows how to setup a decay on post dates, and on a post custom field (could be a price for instance).
The results are then reordered both by freshness and relevancy, or price and relevancy.