public abstract class SearchReport extends Object
Learn more
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
for (SearchReport report : reports) {
System.out.println("Query: " + report.getTextQuery());
DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
System.out.println("Time: " + df.format(report.getStartTime()));
System.out.println("Duration: " + report.getSearchDuration());
System.out.println("Documents: " + report.getDocumentCount());
System.out.println("Occurrences: " + report.getOccurrenceCount());
System.out.println();
}
| Constructor and Description |
|---|
SearchReport() |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
getDocumentCount()
Gets the number of documents found.
|
abstract Date |
getEndTime()
Gets the end time of the search.
|
abstract SearchQuery |
getObjectQuery()
Gets the search query in object form.
|
abstract int |
getOccurrenceCount()
Gets the total number of occurrences found.
|
abstract double |
getSearchDuration()
Gets the search duration in seconds.
|
abstract SearchOptions |
getSearchOptions()
Gets the search options.
|
abstract Date |
getStartTime()
Gets the start time of the search.
|
abstract String |
getTextQuery()
Gets the search query in text form.
|
abstract String |
toString()
Returns a String that represents the current
SearchReport. |
public abstract int getDocumentCount()
public abstract Date getEndTime()
public abstract SearchQuery getObjectQuery()
public abstract int getOccurrenceCount()
public abstract double getSearchDuration()
public abstract SearchOptions getSearchOptions()
public abstract Date getStartTime()
public abstract String getTextQuery()
Copyright © 2026. All rights reserved.