检查索引中是否存在文档的条件(Lucene.NET)
我正在使用Lucene.NET,我想在索引之前检查文档是否包含在索引中,这样如果是,我不需要将其存储在索引中,但我可以跳过它。我读过一些有同样问题的问题,但它们都涉及删除并使用新文档更新它。我不想这样做,因为文档将包含完全相同的数据,并且再次存储它是没有用的。我有一个充当 ID 的字段,称为 URL,其中每个文档都包含其特定的 URL。因此我有一种方法可以识别特定的文档,我只是不知道应该使用什么条件。
有什么帮助吗?
I am using Lucene.NET and I would like to check before whether a document is contained in the index, so that if it is, I do not need to store it in the index, but I can skip it. I've read some questions that had the same problem, but they all dealt with deleting and updating it with the new document. I don't want to have to do that since the document will contain the exact same data and it would be useless to store it again. I have a field that acts as an ID called URL where each document contains its specific URL. therefore there is a way for me to identify the specific document, I just don't know what condition I should use.
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会使用这样的东西:
I would use something like this: