如何查明内容是否已被 Apache Solr 索引

发布于 2024-12-28 02:49:28 字数 190 浏览 3 评论 0原文

我正在为一个电子商务项目添加搜索功能,我需要集成 Apache Solr 搜索服务器来进行搜索。我能够使用 Apache Solr 对网站内容建立索引,但问题是每当用户搜索时,所有产品内容都会在 apache solr 中建立索引,即使它已经建立索引。有什么方法可以查明我的内容是否已被 Apache Solr 索引,这样我就不需要再次索引内容

谢谢

I am working on adding the search capabilities for an e-commerce project and I need to integrate the Apache Solr search server for the searching. I was able to index the site content with Apache Solr, but the problem is whenever a user is searching all the product content is indexed in the apache solr even if it has been indexed already. Is there any way in which I can find out if my content has already been indexed by Apache Solr so that I need not index the content again

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

大海や 2025-01-04 02:49:28

如果您将数据保存在数据库中,然后使用 Solr 对其进行索引,那么解决方案很简单。将时间戳列添加到DB和Solr中的数据中。然后定期检查两者的最新时间戳。当它们不相等时,添加具有较新时间戳的索引内容。

您可以通过 DIH 中的正确查询来做到这一点。欲了解更多信息,请阅读:

If you are holding data in DB and then indexing it with Solr the solution is easy. Add timestamp column to the data in DB, and Solr. Then periodically check latest timestamps in both. When they are not equal, add to index content with newer timestamp.

You can do that with correct query in DIH. For more read:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文