简体   繁体   English

延迟使用FT搜索检索父文档

[英]Delay in retriving parent document using FT Search

i am using FT search on $message id field to retrieve the parent document.my database is FT indexed. 我在$ message id字段上使用FT搜索来检索父文档。我的数据库已被FT索引。 i need the parent document for accepting the meeting invitation. 我需要上级文件才能接受会议邀请。 how ever i am able to retrieve document after 2 hours of getting meeting invitation. 在获得会议邀请2小时后,我如何能够检索文档。 need help. 需要帮忙。

String messageiD="<OFF0E85FF0.91FEF356-ON65257C97.00360343-65257C97.00361318@LocalDomain>";
 if (messageiD.contains("@")) {
                String[] strArr = messageiD.split("@");
                 messageiD = strArr[0].replace("<", "");
                 System.out.println("message id is "+messageiD);
                //return messageiD;
            }

            String qry = "Field $MessageID CONTAINS " + messageiD;
            DocumentCollection col1 = m_database.FTSearch(qry);
            System.out.println("doc col length is " +col1.getCount());
            Document docOld = col1.getFirstDocument();
            System.out.println(docOld.getNoteID());

If you are able to retrieve the result one hour / two hours later, then the FT- Index is not up to date, when it tries to process your request. 如果您能够在一小时/两个小时后检索到结果,则FT-Index在尝试处理您的请求时不是最新的。 Use method updateFTIndex() of NotesDatabase- class to make sure, it is up to date. 使用NotesDatabase-类的方法updateFTIndex()可以确保它是最新的。 Of course you can check, if it IS up to date, using getLastFTIndexed()- Method... Here is example- code from the Designer- Help to use these two methods: 当然,您可以使用getLastFTIndexed()-方法来检查它是否是最新的-这是示例-Designer-帮助中的代码,以使用这两种方法:

 try {
  Session session = getSession();
  AgentContext agentContext = 
      session.getAgentContext();
  // (Your code goes here) 
  Database db = agentContext.getCurrentDatabase();
  String title = db.getTitle();
  DateTime lastDT = db.getLastFTIndexed();
  DateTime nowDT = session.createDateTime("Today");
  nowDT.setNow();
  int daysSince = 
      nowDT.timeDifference(lastDT) / 86400;
  if (daysSince > 2) {
    System.out.println("Database \"" + title +
            "\" was last full-text indexed " + 
             daysSince + " days ago");
    System.out.println("Updating");
    db.updateFTIndex(true); }
  else
    System.out.println("Database \"" + title +
         "\" was full-text indexed less 
          than two days ago");

} catch(Exception e) {
  e.printStackTrace();
}

Additional Information: When creating a fulltext index for a database you define, how often this index is updated. 附加信息:在为您定义的数据库创建全文索引时,此索引的更新频率。

But: Even when selecting "Immediate" in the dialog, this does not mean, that the index will always be up to date. 但是:即使在对话框中选择“立即”,这也不意味着索引将始终是最新的。 Updating the fulltext is a job of the Update- task of the server. 更新全文是服务器Update-任务的工作。 If this task is to "busy" then the request is queued and might be delayed for some time until there are resources available for doing the job. 如果此任务要“忙”,则请求将排队,并且可能会延迟一段时间,直到有足够的资源来执行此工作。

The performance of fulltextindex updates can be enhanced by the server admin by setting a notes.ini- Variable "UPDATE_FULLTEXT_THREAD" (see this link about the variable to check details). 服务器管理员可以通过设置notes.ini来增强全文索引更新的性能。变量“ UPDATE_FULLTEXT_THREAD”(请参阅此变量链接以检查详细信息)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM