/
Front-End search performance improvements [5.2.2-B2]

Front-End search performance improvements [5.2.2-B2]

In-Portal supports search across whole catalog on Front-End. Here is what happens internally for each catalog item (category, product, link, etc.):

  1. drop temporary search table if it exists
  2. create temporary search table with results OR append results to it (when catalog items of different types found)

During regular search page load fact, that instead of truncating a table it's being dropped and recreated isn't a bid deal. However when based on search page developers attempt to create AJAX auto-suggestion template, where on every key press same drop/create table code happens the racing condition might happen, when:

  • one AJAX requests checks for table existence
  • another AJAX requests immediately drops that table

Solution

  1. in the "OnSimpleSearch" events:
    1. use "MEMORY" engine, when creating temp search table (improves speed)
    2. instead of dropping temp search table clean it using "TRUNCATE TABLE" database query
  2. in the "\kSearchHelper::ensureEmptySearchTable" method:
    1. create temp search table in memory and only, when it's missing
    2. clean temp search table using "TRUNCATE TABLE" database query

Related Tasks

INP-1769 - Getting issue details... STATUS