"Long Tail" search configuration

Using "Long Tail" you can configure search by SKU, abbreviations, etc.

To receive the correct search results for words that contain dashes or other non-alphabetic symbols, we recommend using the long-tail search feature.

Go to System / Search Management / Settings / Mirasvit Extensions / Search
In the section Search Settings go to the option Long tail.
There you can set up regular expressions to receive required search results.

  • Match Expression - the regular expression(s) that parses words for further replacing.

    Parsing goes for search index, during an indexing process, and goes for search phrases during search. E.g. /([a-zA-Z0-9]*[\-\/][a-zA-Z0-9]*[\-\/]*[a-zA-Z0-9]*)/

  • Replace Expression - the regular expression(s) to parse characters to be replaced. Parsing goes in the results of "Match Expression". E.g. /[\-\/]/
  • Replace Char - the character to replace values founded by "Replace Expression". E.g. empty value.

Tip

How it works?

During reindex, the extension matches the search index by Match Expression and then replaces chars in the matches from Replace Expression to Replace Char.
Same actions the extension does for each user's search phrase. As result, the search index and the search query contain the same search phrase form.

For example, we have a product Canon PowerShot SX500 IS.

If the customer is searching for the Canon PowerShot SX-500IS, the default search will not find the mentioned product.

Using "Long-tail" search, the search function recognizes the characters combination by pattern during reindex and search (by match expression) and replaces special characters (replace expression) to the empty ones or any other characters (replace char).

So, during reindexing the SX500 IS will be converted to the SX500IS and during the search, the SX-500IS will be converted to the SX500IS aswell.

As a result, the search will be able to find products by several combinations of spelling the product's name.

Example 1

  • Match Expression - /[a-zA-Z0-9]*-[a-zA-Z0-9]*/
    Matched text: SX500-123, GLX-11A, GLZX-VXV, GLZ/123, GLZV 123, CNC-PWR1
  • Replace Expression -/-/
  • Replace Char - empty
    Result text: SX500123, GLX11A, GLZXVXV, GLZ/123, GLZV-123-123, CNCPWR1

Example 2

  • Match Expression - /[a-zA-Z0-9]*[ \-\/][a-zA-Z0-9]*/
    Matched text: SX500-123, GLX-11A, GLZX-VXV, GLZ/123, GLZV 123, CNC-PWR1
  • Replace Expression - /[ \-\/]/
  • Replace Char - empty
    Result text: SX500123, GLX11A, GLZXVXV, GLZ123, GLZV123, CNCPWR1

Example 3

  • Match Expression - /[a-zA-Z0-9]*[-\/][a-zA-Z0-9]*([-\/][a-zA-Z0-9]*)?/
    Matched text: SX500-123, GLX-11A, GLZX-VXV, GLZ/123, GLZV-123-123, CNC-PWR1
  • Replace Expression - /[-\/]/
  • Replace Char - empty
    Result text: SX500123, GLX11A, GLZXVXV, GLZ123, GLZV123123, CNCPWR1

You may also configure Global Search options