duanke3985 2013-11-30 20:57
浏览 23
已采纳

狮身人面像搜索PHP - 良好的做​​法

I'm integrating sphinx search with php api in my website and I've got a question.

What is the best practice : - Select only IDs with sphinx, and make an other request in mysql in order to select the other fields (I've some join), with a WHERE IN (ids...) SQL request (but how to keep the same order ?) - Select all datas with sphinx

Thanks.

  • 写回答

1条回答 默认 最新

  • doufangxian4985 2013-11-30 21:08
    关注

    I recommend selecting only IDs and then WHERE IN.

    Why? For example, you have to search within articles and then - associate them with authors. Why duplicate data you're not searching within? Sphinx/Lucene/ElasticSearch primary objective is to index and accelerate process but NOT to replace a database (of course, I'm not saying that's impossible but what's the purpose?).

    The less data to index, the faster you get the results.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿