PHP Smart Search Engine for Mysql Table Tips

I am creating a search engine for my php based website. I need to find a mysql table.

The bottom line is that the search engine should be pretty “smart” so that users can easily find their products (this is an ad website).

I have currently created a FULLTEXT search using this piece of code:

    MATCH (headline) AGAINST ($querystring)

But this is not enough ...

For example, let's say a field headlinecontains something like Bmw 330ci. If I search 330, I will not get any results. The ending ('ci') is just one of many car model endings to consider when searching the table.

Or what if the field headline bmw330? There are also no results, because it matches only complete words.

Or also that if headline- bmw 330and I’m looking bmw 520, but with FULLTEXT I will get bmw 330as a result, although I searched bmw 520... Not good!

How do I solve this problem?

+3
source share
3 answers

When it comes to full-text search, people who want free solutions often use Sphinx or Solr .

I did not use either of these two, but I read several times that they are great and easy to use with / from PHP and MySQL.

+3
source

. , BMW, BMW 330CI, BMW 320CI .. , Google, .

, .

0

: , , , . , .

, Apache Lucene [1], , Apache Solr [2] Elastic Search [3]

, . , .

[1] http://lucene.apache.org
[2] http://lucene.apache.org/solr
[2] https://www.elastic.co/products/elasticsearch

0
source

Source: https://habr.com/ru/post/1725249/


All Articles