Our docs are written to reach the widest audience. We do not try to address every situation that our customers will face. At some point, more individualized guidance is required.
For this, we offer several strategies to help you troubleshoot:
Get ranking information with the getRankingInfo parameter. This parameter allows you to look at and analyze the criteria Algolia uses to rank results. For a given query it returns the value for each ranking criteria. By understanding those values you can understand why a result appears before or after another. See more below.
Reproducing a problem on a small dataset and solving it by process of elimination. This strategy can be used alongside the getRankingInfo parameter. It helps you improve the results of specific queries. The idea is to create a very small index that mirrors your main index, and to test different configurations one-by-one until you’ve singled out the problem or inefficiency.
Analytics and Insights. This allows you to follow your users’ behavior with Analytics. See more about this in our Analytics guide.
The Engine’s Ranking Decisions
You can find out why a record is ranked the way it is, and use this information to troubleshoot your data and relevance settings. You can do this in the Dashboard or via the API.
Troubleshooting in the dashboard
If you go to your dashboard and search, you have a “Ranking Info” section that details how Algolia ranked this record.
If you look at the second hit, you’ll have the difference between this object and the one above it.
Troubleshoot via the API
Ranking information can be retrieved via the API. For that, you need to use the parameter getRankingInfo and set it to true.
// composer autoloadrequire__DIR__.'/vendor/autoload.php';// if you are not using composer// require_once 'path/to/algoliasearch.php';$client=\Algolia\AlgoliaSearch\SearchClient::create('YourApplicationID','YourAdminAPIKey');$index=$client->initIndex('your_index_name');
// for the default versionconstalgoliasearch=require('algoliasearch');// for the default versionimportalgoliasearchfrom'algoliasearch';// for the search only versionimportalgoliasearchfrom'algoliasearch/lite';// or just use algoliasearch if you are using a <script> tag// if you are using AMD module loader, algoliasearch will not be defined in window,// but in the AMD modules of the pageconstclient=algoliasearch('YourApplicationID','YourAdminAPIKey');constindex=client.initIndex('your_index_name');