BlogProduct

Parallel indexing

Written by Piotr Korsak
Max 2min read

A properly built index is one of the key factors for a search engine to perform fast and reliably. We would like to introduce an improved indexing methodology, which we’re adopting with the v1.19.0 version of FiboSearch. Here comes parallel indexing!

Please consider that having a custom index is itself a FiboSearch Pro feature. This article is mainly aimed at our Pro adopters.

Table of Contents

Identifying the issue with index building

While building the index is a relatively simple and foolproof process, there is a special caveat. While the index is being built, any more complex search functionalities are inaccessible – we’ll get into more detail soon. This might not be a problem for smaller stores, where the whole process takes a minute or two. But for stores with thousands and more products, you’ll ultimately want your customers to be able to use all the sophisticated search tools while the index is being rebuilt.  

We’ve tweaked and improved the search building process. From now on, the old index will be available for your customers throughout the entire process while the new index is being built. Only after this has finished will the older index be removed and the new one take its place. The technicalities of the process will be described in further sections.

FiboSearch Free vs Pro – different search engines

To elaborate on the previous methodology, it’s a good starting point to state the difference between the FiboSearch Free and Pro versions. Despite both of them offering great speed and search relevance, they use different methodologies to achieve the results.

FiboSearch Free

FiboSearch Free uses an ordinary WP_Query class for any search-related tasks. If you’re more interested in this topic, please refer to this article.  This method is efficient enough for simple searches, but lacks the flexibility that comes with our Pro features.

FiboSearch Pro

On the other hand, FiboSearch Pro uses its own, custom built index. With this functionality come all the goodies that make the Pro version stand out: ultra-fast search engine, fuzzy search, searching in custom fields, adding synonyms lists, and dozens of other features. A full list of differences between Free and Pro versions can be found on this list.

Up to this point, while building/rebuilding the index, the Pro version had to resort to the WP_Query for search-related tasks. This also meant that all the bells and whistles were missing until the index was finally rebuilt. Worse still, we had to narrow down the search process to product names only, for speed related reasons.

Here’s a visual example of the difference between the previous and current method. Let’s assume that the customer wants to search for some product using a custom field. We’ll show you this based on a unique ISBN number in our mockup store, The Bookstore Online. With version v1.18.0 and lower, the index rebuilding process will make it impossible – all the Pro features are blocked.

With v1.19.0, a customer can search via ISBNs to their hearts’ content, even with the index building process running in background. 

Parallel indexing

With the adoption of parallel indexing, we’re ditching the WP_Query workaround for our Pro users. Now your clients will be able to use the search engine as usual, based on the previously up-to-date index, while the new indexing is built in the background. All the Pro features will remain intact. Only after the newer index has been finished will the old tables be replaced by the new ones.

Important notice!  There is one case when the use of the previous index-building method is a must – updating the plugin. Please consider manually updating FiboSearch when the traffic in your store is limited, preferably at night.

Considerations

  • As there’ll temporarily be two parallel indexes in your database, it’s worth considering that the database will be bigger for the time being. Make sure that the size of your database is suitable for this process. Consult with your hosting or database administrator should any issues arise.
  • During the building process, a different message will appear in FiboSearchIndexer tab
This is a confirmation that there are already two parallel indexes in your database: the one being built and the previous one, used solely for search-related tasks
  • During the building process a different message might also appear:
That means that the new index is being built. However, the building process was not triggered by you, but automatically during a plugin update – this will also mean that the search-related tasks will be the same as in the Free version of the plugin (see above). First the old index will be removed and only then will the new index be built. Afterwards, the building/rebuilding process will use the parallel building procedure until the next update.

Disabling parallel indexing

For those of you who don’t want to use parallel indexing, you can disable it completely. Please add this code to your wp-config.php file:

define( 'DGWT_WCAS_PARALLEL_INDEX_BUILD', false );

Leave a Reply

Please keep in mind that your email address will NOT be published