How can i get result if word wrong or spelling wrong or Greek word enter get English result example:
in my web site i want to search "jeans" or "jenz" get same result its a simple examples my main concern if user enter same meaning word or wrong greek word but my site develop in English format how can this word search
can any one give me idea how i get solution for this problem my site in Laravel 5.2
For the "spelling wrong" part (Did you mean)
You could do some LIKE
queries in the db e.g. LIKE %j%e%a%n%s%
but if you want to do it well, you should use a search library like this:
You can publish the configuration file to your app directory and override the settings by running php artisan vendor:publish to copy the configuration to your config folder as searchy.php
You can set the default driver to use for searches in the configuration file. Your options (at this stage) are: fuzzy, simple and levenshtein.
You can also override these methods using the following syntax when running a search:
By defining levenshtein distance you can finetune how far off a word can be.
solr
or elasticsearch
for this task.https://wiki.apache.org/solr/SpellCheckComponent https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html
For the translation part
You just should have a dictionary ready in your database or localization files and run the input trough that as well. Expect high computing times for both spelling correction and translation in your code.