Reverse Index Lookup for Query Optimization
The reverse index lookup allows you to optimize search query in Backoffice Product Content Management. You can change the default category-based search from expensive query and fast indexing to inexpensive query and demanding hot update, depending on your requirements.
You can determine how you want to build Solr query in Backoffice Product Content Management to make the search effective in all kinds of catalogs. You can enable a reverse index lookup in the catalog structure of the Products View and Assortment View with the backoffice.search.reverse.category.index.lookup.enabled setting.
In the default configuration, the backoffice.search.reverse.category.index.lookup.enabled setting is set to false. The standard behavior of search in the Explorer Tree is that each time you select a category, Solr gets its subtree and performs a search using all passed categories.
Enabling the reverse index lookup (backoffice.search.reverse.category.index.lookup.enabled set to true) changes the behaviour of building the query for category-based search. In the search index, the whole branch (or branches) of category tree that a product belongs to are indexed. The search query contains only the selected category. The query is concise and therefore faster, but any change in the catalog structure requires an index update.
| Standard Index | Reverse Index | |
|---|---|---|
| Pros | Only the categories that the products directly belong to in the index | Short search query containing minimum data |
| Faster indexing | Fast queries | |
| No need for hot index update after changes to the category tree | No need to change query method to use POST | |
| Cons | Long search queries for large catalogs (changing the query method from GET to POST recommended) | Any change to category tree requires updating all products belonging to its subtree |
| Risk of exceeding the maximum number of the conditions that Solr allows | Longer time of hot update of the index | |
| Expensive query building |