8.7.15. Configure Ukrainian morphology in Manticore Search

Morphology allows you to find similar words. For example, if Ukrainian morphology is configured, a search for the word "кіт" will return results with the words "коти", "котів", etc.

For Ukrainian morphology to work, tables must have the following settings specified:

  • "Morphology" — "lemmatize_uk_all" (can be specified together with other morphologies).
  • "Encoding table" — as in the tooltip below the field in the table settings:
    0..9, _, A..Z->a..z, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F, U+404->U+454, U+454, U+406->U+456, U+456, U+407->U+457, U+457, U+490->U+491, U+491, U+401->U+435, U+451->U+435, U+002D
  1. Add to allowed IP address from which you will connect to Manticore Search (without it connection via MySQL will not work).
  2. Connect to Manticore Search via MySQL:
    • Use the host and port from the row "MySQL" in the "Instance" block in the "Manticore Search" section.
    • You can specify any database name and password, or do not specify them at all (they are ignored).
    • You can connect via console or any MySQL client.
    • Example command to connect via console:
      mysql -h example.manticore.tools -P 10000
  3. Create a table with the desired settings:
    • You can create them either via the control panel or using SQL queries.
    • Example SQL queries for creating a table:
      CREATE TABLE tbl (f text) charset_table='non_cjk,0..9,_,A..Z->a..z,a..z,U+410..U+42F->U+430..U+44F,U+430..U+44F,U+404->U+454,U+454,U+406->U+456,U+456,U+407->U+457,U+457,U+490->U+491,U+491,U+401->U+435,U+451->U+435,U+002D' morphology='lemmatize_uk_all';
      INSERT INTO tbl VALUES(1,'Коти ловлять мишей');
      INSERT INTO tbl VALUES(2,'Миша боїться котів');
    • Multiple morphologies can be specified separated by commas, e.g. morphology='lemmatize_uk_all, lemmatize_en_all.
  4. Search for the desired word in the table (highlight() highlights the found word):
    • Searching on the word "кіт" in the example above will return strings with the words "коти" and "котів":
      SELECT highlight() FROM tbl WHERE MATCH('кіт');
    • Searching on the word "боятись" in the example above will return a string with the word "боїться":
      SELECT highlight() FROM tbl WHERE MATCH('боятись');
Content