There is a dictionary of translations of scientific terms. If you enter a query
LIKE% line% - will display:
approaching line online reservation line liner But the following order is needed:
line approaching line online reservation liner Already wrote a sample of the database, but I do not know how to make a conclusion in the right order
$Obj = RussianModel::where(function ($query) use ($search) { // ТОЧНОЕ СОВПАДЕНИЕ $query->where('translate', 'ILIKE', '' . $search . ''); // Точное совпадение $query->orWhere('translate', 'ILIKE', '' . $search . ' %'); // Слово в начале строки $query->orWhere('translate', 'ILIKE', '% ' . $search . ''); // Слово в конце строки $query->orWhere('translate', 'ILIKE', '% ' . $search . ' %'); // Слово в середине строки // ЧАСТИЧНОЕ СОВПАДЕНИЕ $query->orWhere('translate', 'ILIKE', '%' . $search . '%'); // Любое возможное совпадение })->get(); Already did 5 consecutive requests, combined the results. But this is not very good. Maybe there is another way to search?