Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Lucene/solr 在文件上传应用程序中进行搜索和导航,我需要为每次下载更新每个文档的索引值“已下载”。
digg.com 也发生了同样的情况,当你搜索时,每个链接都有多少个“diggs”
我是否必须为每次下载删除/插入新文档。还是有更好的东西?
根据Solr Wiki上的常见问题解答,您不能部分更新文档:
在 Lucene 中更新文档的操作实际上是先删除再添加。您将需要添加完整的文档,因为 Lucene 中没有这样的“仅更新字段”语义。
如果要更新字段,则必须添加整个文档。