Starting the Search Service

The search-service-start function (SearchServiceStart in the SOAP API) enables you to explicitly start the Search Service. The Search Service is typically started automatically as part of the system boot process, but you may need to explicitly start it from administrative applications or after making any changes to its configuration.

The following code example shows how to start the Search Service in C#, using the SOAP API:

    bool startok = false;
    try
    {
        SearchServiceStart sss = new SearchServiceStart();
        port.SearchServiceStart(sss);
        startok = true;
    }
    catch (Exception e)
    {
    }
    
    Debug.Assert(startok, "unable to start search service");
    
    sssxml = new SearchServiceStatusXml();
    stat = port.SearchServiceStatusXml(sssxml);
    notRunning = stat.SelectNodes("@not-running");
    
    Debug.Assert(notRunning == null || notRunning.Count == 0);