On this page
The first step to take when setting up and configuring your index is to decide which attributes you want to use for searching, and in what order and manner you’ll search them. We have already covered the first subject in our data section - that of selecting the best attributes.
Now we want to focus on several methods that give you control over the ranking-priority of your selected attributes. These methods are critical for obtaining good results. As you’ll see, not every attribute is equal, nor do they serve the same purpose in terms of obtaining relevant results.
One thing to keep in mind when configuring your attributes is to realize that even a small change to your searchable attributes can have a significant impact on your results. This is what makes it both rewarding and challenging. We encourage you to do this but also warn you to be careful.
By default all textual attributes that have been pushed into an index are searchable. You should spend some time configuring the searchable attributes on your indices, because you may not want to search through every textual attribute.
Selecting your attributes
A classic example of a useful searchable attribute is the name of a product. An example of an attribute that is not useful for searching is a URL. URLs should not be included in the list of searchable attributes. There are very few use cases where users search for URLs. Instead, the image URLs in your index are used for displaying images in the results.
Here are some guidelines about which attributes to include and exclude from the searchable attribute list. These suggestions are not exhaustive.
The following attributes are commonly included (i.e., are searchable):
- Descriptive attributes: name, description, brand, list of actors in a film, list of features in a computer.
- Filters: color, brand, size.
- Keywords and tags.
- Useful data like telephone numbers, SKU, ISBN, and other such identifying attributes.
These are often excluded (i.e., not searchable):
- For display only: image and other URLs, price, brand logos, SKU.
- Short descriptions intended for display only. Short descriptions usually summarize what’s in a longer description. So the logic would be to have a simple description for display and a less-readable one with keywords and text used for search purposes only.
- For information only: not yet available, just released, on promotion.
- For ranking only: most-sales, most-viewed, highest rated.
Ordering your attributes
How you order your searchable attributes impacts ranking. More specifically, it plays a role in the tie-breaking formula. When the engine is comparing two records for ranking purposes, it compares the highest attributes in the list of searchable attributes first and works its way down to the lowest in the list.
An example would help.
- The query is “red”.
- You’ve placed the
colorattribute higher in the searchable attributes list than
- If record 1 has matched on
color, and record 2 has matched only on
name, then record 1 wins, and is therefore placed higher in the results.
When thinking about which attributes to put at the top, don’t only think concerning which attributes best describe a product. The goal here is about ranking: Which attributes can help achieve the best ranking? In some situations attributes with less text but exact terms (like colors, categories, or brand) can lead to better relevance.
Position of matching words in your attributes
Matching word position also impacts ranking. By default, matches at the beginning of an attribute rank higher than matches in the middle or the end. You can change the default to ignore position, making all matches equivalent in terms of ranking. Let’s look at an example.
- Query “brad”
- Record 1, name: “Brad Pitt”
- Record 2, name: “Son of Brad Pitt”
The default behavior will rank record 1 higher than record 2, because “brad” matches record 1’s name attribute in the beginning. If you were to change the default, both records would be ranked the same.
This is done by either keeping searchable attributes ordering as is, or defining them as