A
A
Andrew Chorniy2015-04-21 14:44:40
PHP
Andrew Chorniy, 2015-04-21 14:44:40

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

5 answer(s)
P
Puma Thailand, 2015-04-21
@opium

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

P
Philipp, 2015-04-21
@zoonman

No need to reinvent the wheel when Sphinx already exists .

M
Mikhail Lyalin, 2015-04-21
@mr_jok

look towards ready-made solutions

J
JSmitty, 2015-04-24
@JSmitty

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.

O
Oleg Batishchev, 2015-11-03
@z0rg

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 question

Ask a Question

731 491 924 answers to any question