Skip to content
msCatalyst
msCatalyst
Faceted filter, search and catalog sync for miniShop2 and MiniShop3
  • MODX 2
  • MODX 3
  • miniShop2
  • miniShop3
  • PHP 7.2
  1. Extras
  2. msCatalyst
  3. Snippets
  4. msCatalystSearch

msCatalystSearch ​

A search field for the site header: dropdown suggestions, a jump to the results page, or both. It uses the same index as the filter.

modx
[[!msCatalystSearch?
  &searchMode=`live+page`
  &searchPage=`10`
  &parents=`5`
  &searchFields=`pagetitle^3, ms:article^5`
]]

Modes ​

ModeWhat happens
filterTyping narrows the catalog results. Default mode for the msCatalyst snippet.
pageSubmitting the form leads to the &searchPage page.
liveSuggestions appear under the field without a page reload.
live+pageSuggestions, plus a jump to the results page on Enter. Default mode for msCatalystSearch.

On the results page, call msCatalyst with the same &parents: it reads the query from the URL and shows the found products together with the filters.

Properties ​

PropertyDefaultDescription
parentsIDs of the catalog categories to search in.
depth10How deep to look for products inside the categories.
searchModelive+pageMode, see above.
searchPageID or URL of the results page.
searchFieldspagetitle^3, longtitle, ms:article^5, introtext, description, contentSearch fields with weights.
searchParamsearchURL parameter for the query.
searchMin2Minimum query length.
suggestLimit8Number of suggestions.
tplSuggestmsCatalyst.suggestChunk for one suggestion.
toPlaceholderWrite the output to a placeholder.

How search works ​

  • Word forms: "кроссовки" (sneakers) finds "кроссовок" and "кроссовками" (other grammatical forms of the same word). phpMorphy is used if it is installed on the server. Without it, the built-in stemmer works.
  • Transliteration: krossovki finds кроссовки (sneakers). For brands that Russian speakers spell by ear, add a synonym, for example найк → nike (найк is Nike spelled in Cyrillic).
  • Typos: кросовки адидас (a misspelled "sneakers adidas") finds Adidas sneakers. Words with digits (part numbers, sizes) are compared exactly or without spaces.
  • Field weights: a match in the part number or title ranks a product above a match in the description.

Synonyms ​

Synonyms are managed on the "Extras → msCatalyst" page, "Synonyms" tab. A rule works one way: найк → nike finds Nike for the query найк, but not the other way round. Synonyms are stored in the mscatalyst_search_synonyms system setting as JSON:

json
{"шланг": "рукав, hose"}

Here "шланг" (hose) also finds products with "рукав" (another Russian word for hose) or "hose".