C# Lucene附加索引(合并)-如何避免重复?

C# Lucene附加索引(合并)-如何避免重复?,c#,lucene,lucene.net,C#,Lucene,Lucene.net,如何确保在合并几个临时索引(可能包含也可能不包含重复文档)时,主索引中只包含一个副本 谢谢这里有一个方法: 前提是每个文件都有一个id,并且重复文件都有相同的id: mark the indexes by I1..Im. for i in 1..m, let Ci = all the indexes but Ii for all the documents Dj in Ii, let cur_term = "id:<Dj's id>" for Ik in Ci I

如何确保在合并几个临时索引(可能包含也可能不包含重复文档)时,主索引中只包含一个副本

谢谢

这里有一个方法: 前提是每个文件都有一个id,并且重复文件都有相同的id:

mark the indexes by I1..Im.
for i in 1..m, let Ci = all the indexes but Ii
  for all the documents Dj in Ii,
  let cur_term = "id:<Dj's id>"
  for Ik in Ci
    Ik.deleteDocuments(cur_term)
merge all indexes
用I1..Im标记索引。
对于1..m中的i,设Ci=除Ii以外的所有索引
对于Ii中的所有文件Dj,

让cur_term=“id:如果id相同,那么内容就不同。可能需要使用一些时间段