SearchPhaseCompleted

EventHub.SearchPhaseCompleted event

Terjadi saat fase pencarian selesai.

public event EventHandler<SearchPhaseEventArgs> SearchPhaseCompleted;

Contoh

Contoh menunjukkan cara menggunakan acara.

string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";

// Membuat indeks
Index index = new Index(indexFolder);

// Pengindeksan dokumen dari folder yang ditentukan
index.Add(documentsFolder);

// Berlangganan ke acara tersebut
index.Events.SearchPhaseCompleted += (sender, args) =>
{
    Console.WriteLine("Search phase: " + args.SearchPhase);
    Console.WriteLine("Words: " + args.Words.Length);
};

SearchOptions options = new SearchOptions();
options.UseSynonymSearch = true;
options.UseWordFormsSearch = true;
options.FuzzySearch.Enabled = true;
options.UseHomophoneSearch = true;
SearchResult result = index.Search("Einstein", options);

Lihat juga