Help > Web Development > Object Reference > Object Reference > ISYSIDB
<a name="kanchor413"></a>ISYSIDB Object
Utility class that helps perform IDB_Function methods while streaming back ISYS engine messages.
ISYSIDB Methods
CancelStops the current IDB function that is running, this may leave the index in a un-searchable state.
ExecuteExecutes the given command against the specified index.
ISYSIDB Properties
CommandThe ISYS IDB_Function command to apply to the index.
EngineMust be set to the parent ISYSEngine before calling Execute.
IndexPathIndicates the path to the index which the command is to be applied
Examples
[VBScript/WScript]
' Create either an ISYSEngine or ISYSAsp object Set ISYS = CreateObject("ISYS.ISYSEngine.9") ' Initialize the ISYSEngine object (only required for SDK) ISYS.InitializeEngine "c:\Program Files\ISYS9", "{Your License Key}" ' Create and instance of the indexer object Set Indexer = CreateObject("ISYS.ISYSIDB.9") Set Indexer.Engine = ISYS Indexer.IndexPath = "{Path to your index}" Indexer.Command = "REINDEX" ' Attach the event to to the object WScript.ConnectObject Indexer, "Indexer_" ' Execute the function Indexer.Execute ' Event method Sub Indexer_OnMessage(Typ, Params) If Typ = "R" or Typ = "M" or Typ = "S" Then WScript.Echo Params End If End Sub
[VBScript/ASP]
<% Sub Log(Text) Response.Write Text & "<br />" Response.Flush End Sub ' Create the ISYSAsp Object Set ISYS = Server.CreateObject("ISYS.ISYSAsp.9") ' Create and prepare the indexer Set Indexer = Server.CreateObject("ISYS.ISYSIDB.9") Set Indexer.Engine = ISYS Indexer.IndexPath = "{Path to your index}" Indexer.Command = "UPDATE" ' Attach the event handler Set Indexer.OnMessage = GetRef("Indexer_OnMessage") Indexer.Execute Sub Indexer_OnMessage(Typ, Params) If Typ = "R" or Typ = "M" or Typ = "S" Then Log Params End If End Sub %>
[Java]
try { IISYSEngine engine = new ISYSEngine(); // Initialize the ISYS engine engine.InitializeEngine("c:\\Program Files\\ISYS9", "{Your license code}", ""); // Create and initialize the indexer ISYSIDB indexer = new ISYSIDB(); indexer.set_Engine(engine); indexer.set_IndexPath("{Path to your index}"); indexer.set_Command("REINDEX"); // Attach events indexer.addEventListener(new IISYSIDBEvents() { public void OnMessage(java.lang.String MessageType, java.lang.Object Params) throws ComException { if (MessageType.equalsIgnoreCase("R") || MessageType.equalsIgnoreCase("S") || MessageType.equalsIgnoreCase("M")) System.out.println(Params.toString()); } }); // Execute the command indexer.Execute(); } catch(com.isys.base.ComException e){ e.printStackTrace(); }
[C#]
class Program { static void Main(string[] args) { // Initialize the ISYS engine ISYSEngine isys = new ISYSEngineClass(); isys.InitializeEngine(@"c:\Program Files\ISYS9", "{Your license code}", ""); // Prepare the indexer ISYSIDB indexer = new ISYSIDBClass(); indexer.Engine = isys; indexer.IndexPath = @"{Path to your index}"; indexer.Command = "REINDEX"; // Prepare the events ((IISYSIDBEvents_Event) indexer).OnMessage += new IISYSIDBEvents_OnMessageEventHandler(ISYSCallback); indexer.Execute(); } static void ISYSCallback(string MessageType, object Params) { if (MessageType == "S" || MessageType == "R") System.Console.Out.WriteLine(Params); } }