我在 PHP/MySQL 中有一个 Holdesk 应用程序。我想实现实时全文搜索,我已经入围了 Solr。 MySQL 数据库将存储所有搜索所需的数据,并将导入用于构建 Solr 索引的数据。所有搜索请求都将由 Solr 处理。
我想要的是
根据我对 Solr 的理解,这就是我认为系统的工作方式。用户更新票证 -> 修改相应的数据库记录 -> 向 Solr 服务器发送请求以修改索引中的相应文档。
我读过一本关于 Solr 的书,下面的问题困扰着我。
"commits are slow in Solr. Depending on the index size, Solr's auto-warming configuration, and Solr's cache state prior to committing, a commit can take a non-trivial amount of time. Typically, it takes a few seconds, but it can take some number of minutes in extreme cases"
如果这是真的,那么我如何知道数据何时可用于搜索以及如何实现实时搜索?即使它需要几秒钟,也不能是实时的。此外,我不希望票证更新操作变慢(通过添加更新 Solr 索引的额外步骤)
"there is no transaction isolation. This means that if more than one Solr client were to submit modifications and commit them at overlapping times, it is possible for part of one client's set of changes to be committed before that client told Solr to commit. This applies to rollback as well. If this is a problem for your architecture then consider using one client process responsible for updating Solr."
这是否意味着由于缺乏事务性提交,如果多人同时更新票证,Solr 会搞砸?
现在摆在我面前的问题是:我可以使用 Solr 实现这两者吗?如果是,如何?
编辑 1:
是的!我遇到了几个类似的问题,但没有一个有令人满意的答案。所以又发帖了。对不起,如果您发现它重复。
最佳答案
您请求的功能称为近实时搜索,也称为 NRT。 NRT 的工作仍在进行中,但在过去几年中,Solr 中的这种支持已经有了很好的增量改进。有关 NRT 当前(1.4 - 3.5 版)和 future (4.0 版)支持的更多详细信息,请参阅以下链接。
NRT 选项
关于solr - 关于 Solr 的几个问题。交易和实时搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9309914/