dongqiuge5435 2015-12-22 11:24
浏览 18

使用PHP进行产品搜索

I'm looking for a product search function for an onlineshop. The shop has 3500 items. The items can be found in a mysql database or in a file. I want to get the products which match the search term best. The search term should be compared with the productname.

Because a search function is one of the most important parts of an onlineshop i'm looking for a very efficent solution. Does someone know a solution which is easy to implement? It's doen't need to be for free.

UPDATE:

What i tryed until now is to compare the term with the productname. First i'm looking if the term could be found 1on1. After that i take the single words in the term and check if they could be found in productnames. This works, but it's not accurate enough.

  • 写回答

3条回答 默认 最新

  • dougou7782 2015-12-22 11:30
    关注

    If you are atleast familiar with php and know how to query database, i suggest you to use this documentation, eventually you will know what to do with it.

    http://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html

    In short, LIKE is something like comparasion operator, just match by pattern. In your example lets say productname LIKE "%searchterm%".

    I hope this can help you. Regards

    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100