Answer the question
In order to leave comments, you need to log in
I can't figure out how to write a site search in php?
Hello to all.
I ran into a problem that I had never done before. I'm just starting to learn how to program and my task is to add my search on the site. The search should work as follows:
there is a product in the database with the name "Sony Xperia LCD new model 2015" if I enter the full name (or part of the name, the main thing is the usual LIKE) then everything works correctly, but I need to enter for example:
"sony LCD " or "sony 2015" and it should show products that contain these words in the title.
Thanks in advance to everyone.
Answer the question
In order to leave comments, you need to log in
Search for each word separately and then aggregate the results, if the database is small then it will work, if the database is large then fasten sphinxsearch
PostgreSQL supports full-text search out of the box, incl. with word forms in Russian, the base level is set up very quickly, everything is described in the official documentation . There is native support for deleting tags, relevancy settings, thesauri synonyms, and so on, in the future you can expand in any direction.
No need to invent a bicycle search, use what has already been invented before you - Sphinx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question