Examples: createFTIndex method

This agent creates or recreates a full-text index in the current database.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      int options = Database.FTINDEX_ALL_BREAKS +
        Database.FTINDEX_CASE_SENSITIVE;
      if (db.isFTIndexed())
      {
        db.createFTIndex(options, true);
        System.out.println("Database index recreated");
      }
      else
      {
        db.createFTIndex(options, false);
        System.out.println("New database index created");
      }

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