Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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

  • No labels