doushi7805 2010-11-03 05:39
浏览 26
已采纳

我想在http://www.go4film.com上改进我的搜索工具

I need help in building custom search engine for my website http://www.go4film.com.

Although my website search works perfectlly in finding movie but the problem is that if I made a search on my website using the search term "State Department File" as there is a movie named 'State Department File' was already in my database then my search engine perfectly working in finding the movie but the problem is that it shows all movies related to the terms like "State","Department",'File' so it results more than 150 movies fom my database so user had to search again from the search result returns from my website.

SO i need a php script which searches my database and returns the result related to each words in my search query but the first result must be same to the search term so that user find the result in the first page no nedd to search among the results

This is the table where i am using for searching in my database

...

And i need only search in my film_name field.

Please help me out to solve this.

  • 写回答

1条回答 默认 最新

  • duanfaxin7014 2010-11-03 08:06
    关注

    In full-text search you can try playing with:

    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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 求解vmware的网络模式问题
  • ¥24 EFS加密后,在同一台电脑解密出错,证书界面找不到对应指纹的证书,未备份证书,求在原电脑解密的方法,可行即采纳
  • ¥15 springboot 3.0 实现Security 6.x版本集成
  • ¥15 PHP-8.1 镜像无法用dockerfile里的CMD命令启动 只能进入容器启动,如何解决?(操作系统-ubuntu)
  • ¥30 请帮我解决一下下面六个代码
  • ¥15 关于资源监视工具的e-care有知道的嘛
  • ¥35 MIMO天线稀疏阵列排布问题
  • ¥60 用visual studio编写程序,利用间接平差求解水准网
  • ¥15 Llama如何调用shell或者Python
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?