I want to improve my search at http://www.go4film.com

I need help creating a custom search engine for my site http://www.go4film.com .

Although my site search works fine in finding a movie, the problem is that if I did a search on my website using the search term “Department of State File”, since I already have a movie in my database called “Department of State File "then my search engine works great for finding a movie, but the problem is that it shows all the films related to terms like" State "," Department "," File ", so it gives more than 150 films for my database , so the user had to search again from the result and the search returns from my site.

I need a php script that searches my database and returns the result associated with each word in my search query, but the first result should be the same as for the search query so that the user finds the result on the first page without the initial one to search among the results

This is the table in which I use to search my database

...

And I only need to search in my film_name field.

Please help me solve this problem.

+3
source share
1 answer

In full-text search, you can try:

SELECT
    MATCH('column') AGAINST ('keyword1 keyword2') as Relevance
FROM
    table
WHERE
    MATCH('column') AGAINST('+keyword1 +keyword2' IN BOOLEAN MODE)
HAVING
    Relevance > 0.2
ORDER BY
    Relevance DESC
+1
source

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