When a customer knows what he needs to buy, his first action is to find the product through a quick search.
The presence of a quick drop-down menu with the found products (auto-complete) allows him to find the right product quickly without leaving the search line.
The customer has only to complement the search query with the necessary criteria and then he will see the result.
Customers expect that search results will be shown instantly (they know the experience of Google or Amazon search). But technically it is very hard to achieve such a level of speed in the Magento 2 store.
Every request to Magento needs to initiate Magento core, which speed of initialization limits the speed of our search.
To solve this problem and to greatly speed up the Magento search, we have created and added a new feature to our search extensions. We named it the Fast Mode.
Without fast mode
Before Fast Mode came into usage in our search extensions (Elastic Search Ultimate and Sphinx Search Ultimate), all search queries from the autocomplete passed through the entire Magento 2 query processing chain, that caused significant dropping of the query processing speed.
While the search itself takes a split of a second, the processes of primary initialization, processing, obtaining information on the found products take the lion's share of the whole time.
Sometimes, it happens to take much more time than the search itself does.
With fast mode
After fast mode implementing into our extensions, the processing time for queries decreased by 1000%. In this mode, the average time of results getting is about 0.12 sec.
We succeeded to achieve such a high-performance result due to the exclusion of Magento 2 from the autocomplete search.
At the initialization stage, the search request is intercepted and sent to a separate script, which, after a simple processing, enters the search and returns the result to the client immediately.
Expanding of products indexing process (bin/magento indexer: reindex catalogsearch_fulltext) was required.
During the indexing process, in addition to the information required for the search, we save all the related product information to be displayed in the autocomplete.
Thus, the search engine, whether it is sphinx search or elasticsearch, can immediately return all the necessary information without Magento initializing.
The keys advantage of this approach with the fast-mode is the impressively fast search of autocomplete. The speed is improved in dozens of times!
However, the disadvantages include the increased indexing time of the search index (due to the increase in the required data), and the lack of some search capabilities, such as a long-tail, wildcard exceptions, etc.
Quick search results are always good. However, relevant and fast results are excellent.
With our newly developed option, you get not only high-quality results but also super-fast results.