是否可以查明 FT 指数是否更新?

Is it possible to find out if FT index is updated?

我需要查明 Domino 数据库上的 FT 索引是否已更新。如果未更新,我想显示有多少文档未编入索引,可能吗?

您可以使用数据库方法search(String formula, DateTime dt, int max)搜索在最后一个索引时间戳之后创建或修改的文档,然后统计找到的文档数:

DocumentCollection unindexedColl = db.search("Form=\"specificform\"", db.getLastFTIndexed(), 0);
unindexedCount = unindexedColl.getCount();

这是代码片段:

If(db.lastmodified > db.lastftindexed) Then
    ' Database was modified after index updated , it may be a document or design
    Dim T As New NotesDateTime(db.lastftindexed)
    Dim UnindexedCount As Long
    ' Find the modified document after index updated
    UnindexedCount = db.Search({@All}, T, 0).Count
Else
    ' FT index is up to date
    UnindexedCount = 0
End If
MsgBox UnindexedCount