Question
Currently, the general search in the system works based on the initial characters of the entered values. This means that when entering "5566", it will not display values like 115566, but it will show "55667" and "55668". We have encountered a case where it is necessary for the search to display data not only from the beginning of the string. Is it possible to enable a non-strict search and change the number of characters required for the search to 4?
Answer
MeiliSearch is a search engine based on prefixes, and therefore it cannot find parts of a query that are in the middle or at the end of a word. Regarding partial search: you can generate a field ttm_search with text containing parts (if the parts are known in advance). That is, if you have the number 46027778798 and in it 4602 is a prefix and 777 and 8798 are document numbers and the search is needed specifically by numbers.
Then in ttm_search calculate the full information and separately the parts. Example code in the ttm_search field:
= : rowCreate(field: "index" = str`"Number:" ++ $number + "," ++ "Prefix:" ++ $prefix`; field: "title" = #full_number; field: "catalog" = "orders")
number: strPart(str: #full_number; offset: 7)
prefix: strPart(str: #full_number; length: 4)