SearchReport
Contents
[
Hide
]
SearchReport class
Represents a detailed information on a search operation.
public class SearchReport
Properties
Name | Description |
---|---|
DocumentCount { get; } | Gets the number of documents found. |
EndTime { get; } | Gets the end time of the search. |
ObjectQuery { get; } | Gets the search query in object form. |
OccurrenceCount { get; } | Gets the total number of occurrences found. |
SearchDuration { get; } | Gets the search duration. |
SearchOptions { get; } | Gets the search options. |
StartTime { get; } | Gets the start time of the search. |
TextQuery { get; } | Gets the search query in text form. |
Methods
Name | Description |
---|---|
override ToString() | Returns a String that represents the current SearchReport . |
Remarks
Learn more
Examples
The example demonstrates a typical usage of the class.
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
// Creating an index in the specified folder
Index index = new Index(indexFolder);
// Indexing documents from the specified folder
index.Add(documentsFolder);
// Searching in index
SearchResult result1 = index.Search("Einstein");
SearchResult result2 = index.Search("\"Theory of Relativity\"");
// Getting search reports
SearchReport[] reports = index.GetSearchReports();
// Printing reports to the console
foreach (SearchReport report in reports)
{
Console.WriteLine("Query: " + report.TextQuery);
Console.WriteLine("Time: " + report.StartTime);
Console.WriteLine("Duration: " + report.SearchDuration);
Console.WriteLine("Documents: " + report.DocumentCount);
Console.WriteLine("Occurrences: " + report.OccurrenceCount);
Console.WriteLine();
}
See Also
- namespace GroupDocs.Search.Common
- assembly GroupDocs.Search