douhuo3696 2013-01-25 12:46
浏览 30
已采纳

超快速部分文本匹配的数据库/语言选项[关闭]

I am building a project and require a super fast way of supplying an autocomplete feed with results based on a partial text match.

I will be indexing/searching on only one field in a database, though the database row will have additional data I won't be indexing those fields. I will have approx. 25k rows.

Requirements:

  • Must match anywhere in the field (Lorem Ipsum Dolor Sit Amet would be found when starting to type "Lor", "Ipsum", "olor", "Sit Amet")
  • Needs to be extremely quick at returning results in a JSON feed (though the original source of the data doesn't matter too much)
  • Scalable solution for high traffic

I have reviewed a few options...

  • Using MongoDB like such like query in mongoDB
  • ElasticSearch - not sure if a bit overkill for what I need to do, and haven't seen any exaples of matching the partial text as above
  • SQL LIKE query, but imagine this won't be nearly fast enough?

Programming language isn't too much of an issue but Python or PHP would be preferred.

  • 写回答

2条回答 默认 最新

  • duanchuang1935 2013-01-25 13:00
    关注

    As others have mentioned, a full-text index that performs linguistic and syntactic analysis (tokenizing, stemming, case and accent-normalization, etc) will give you the best results. But this won't come without a certain amount of setup and configuration.

    Check out Solr's Suggester component: http://wiki.apache.org/solr/Suggester, and there is a new one - I think it's called AnalyzingSuggester or some such, which is available with Lucene only, I think, so if you want an in-memory solution you could use that (Java only though).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)