Doofinder logo

Support Documentation

Search icon

Custom Sorting

Video last updated before 2024-12-31

This is a sensitive setting. In this sensitive context, Custom Sorting directly impacts the display order of results. If you're experiencing unexpected outcomes and have been adjusting Custom Sorting, consider resetting this parameter.

Custom sorting allows you to select in which order the result elements from a query will be displayed.

By default, Doofinder arranges searched products based on their relevance, determined by the score assigned by Doofinder's algorithm. This score is a numerical value assigned to each search result, reflecting how closely it aligns with the search criteria. Results are sorted by this score, with the highest-scoring results appearing first. If you want to know more about the score, read the FAQ "What is the score and how is it calculated?".

However, there may be situations where multiple results have identical scores, and the search results do not align with your desired criteria. In such cases, the Custom Sorting feature becomes invaluable. It allows you to define the sequence in which search results should display products.

Altering the Custom Sorting section may impact other configured Promotional Tools, such as Boosting and Custom Results. Therefore, it is advisable to keep the Score on Descending order as the primary rule. This ensures the search engine functions correctly, prioritizing the most relevant products.

In the event that you have configured Custom Sorting, and the results are not as expected, you can easily reset this functionality and make adjustments as needed.

Custom Sorting Fields

In addition to the score field, you can use other attribute fields such as price, sales quantity, availability, stock, etc. to set the display order of your results. Custom Sorting can be done in ascending or descending order, either for numerical or alphabetical values.

  • Numerical values: Ascending order goes from 0 to 99999 and descending order goes from 99999 to 0.

  • Alphabetical values: An ascending alphabetical order sorts the text by the first letter of the first word, with "A" first, and "Z" last.

How to Configure Custom Sorting

To access the Custom Sorting feature in your Admin Panel, go to Search > Advanced Preferences > Custom Sorting > Choose the Search Engine where you want to configure Custom Sorting from the SE dropdown menu in the top bar.

Find Custom Sorting on Advanced Preferences

Next, pick a field from the dropdown menu and specify the desired order, whether ascending or descending. Afterwards, click the "+Add" button, and save your settings by clicking on the "Save" button located at the bottom right of the screen.

See all fields in the Field dropdown menu

The maximum number of fields recommended for sorting is five attributes, but for best search results, refrain from removing the score field from the first position.

The order in which the fields are placed is the order in which the sorting will be executed during the searches. For example, in the case that a product is tied by score, the following custom sorting criteria will be applied to sort that product. And so on with the list of configured fields.

Therefore, it is advisable to always leave score descending in the first position and not to remove it from the Admin Panel. When you add a new field, it will automatically be placed in the first position. So you have to rearrange the order by dragging and dropping them directly to put the score back to the top of the list.

When adding a new field, remember to place the score first

Remember you can always reset the fields as often as you want by clicking the reset option on the left. To delete a field, click on the trash icon on the right side of the screen.

When to Use Custom Sorting

Suppose you have products with the same search score. With Doofinder's Custom Sorting feature, you can specify more than one sort criteria from the dropdown list to add to "score".

Sorting with Numerical Values

In this example, we will choose the "price" field and then determine the sort order, either descending or ascending.

Once the sorting preferences have been set, simply click the "Save" button to apply them. This method ensures that the initial sorting criterion is based on "score" and, in the event of a tie, the "price" criterion is used to sort the results.

Configure the plugin

Sorting with Alphabetical Values

In this example, we apply the availability field. When the sort fields are text fields, the sorting is done alphabetically, which is not always the best. But the exception is the availability field because it usually contains only two values: "in stock" and "out of stock", so in this case Doofinder can sort alphabetically with ease.

This is a special case in which the score field can be placed in the second position of the list in descending order, and the availability field in ascending order in first position, so that the results that will be displayed first will be those with availability "in stock", sorted by score, followed by the results "out of stock", also sorted by score.

Configure the plugin

You can always reset the fields as often as you want. Custom Sorting is not the same as Custom Results. Learn more on Custom Results.

Did you find this page helpful?