IndexingReport

Inheritance: java.lang.Object

public abstract class IndexingReport

Represents a detailed information on an indexing operation.

Learn more

The example demonstrates a typical usage of the class.


 String indexFolder = "c:\\MyIndex\\";
 String documentsFolder1 = "c:\\MyDocuments1\\";
 String documentsFolder2 = "c:\\MyDocuments2\\";
 // Creating an index in the specified folder
 Index index = new Index(indexFolder);
 // Indexing documents
 index.add(documentsFolder1);
 index.add(documentsFolder2);
 // Getting indexing reports
 IndexingReport[] reports = index.getIndexingReports();
 // Printing reports to the console
 for (IndexingReport report : reports) {
     DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
     System.out.println("Time: " + df.format(report.getStartTime()));
     System.out.println("Duration: " + report.getIndexingTime());
     System.out.println("Documents total: " + report.getTotalDocumentsInIndex());
     System.out.println("Terms total: " + report.getTotalTermCount());
     System.out.println("Indexed documents size (MB): " + report.getIndexedDocumentsSize());
     System.out.println("Index size (MB): " + (report.getTotalIndexSize() / 1024.0 / 1024.0));
     System.out.println();
 }
 

Constructors

Constructor Description
IndexingReport()

Methods

Method Description
getTotalDocumentsInIndex() Gets the total number of documents in the index.
getTotalTermCount() Gets the total number of terms in index.
getIndexedDocumentsSize() Gets the total length of indexed documents in MB.
getSegmentCount() Gets the number of index segments.
getTotalIndexSize() Gets the total index size in bytes.
getStartTime() Gets the indexing start time.
getEndTime() Gets the indexing end time.
getIndexingTime() Gets the indexing duration in seconds.
getErrors() Gets the list of errors.
getIndexedDocuments() Gets the list of indexed documents.
getUpdatedDocuments() Gets the list of updated documents.
getRemovedDocuments() Gets the list of removed from index documents.

IndexingReport()

public IndexingReport()

getTotalDocumentsInIndex()

public abstract int getTotalDocumentsInIndex()

Gets the total number of documents in the index.

Returns: int - The total number of documents in the index.

getTotalTermCount()

public abstract int getTotalTermCount()

Gets the total number of terms in index.

Returns: int - The total number of terms in index.

getIndexedDocumentsSize()

public abstract double getIndexedDocumentsSize()

Gets the total length of indexed documents in MB.

Returns: double - The total length of indexed documents in MB.

getSegmentCount()

public abstract int getSegmentCount()

Gets the number of index segments.

Returns: int - The number of index segments.

getTotalIndexSize()

public abstract long getTotalIndexSize()

Gets the total index size in bytes.

Returns: long - The total index size in bytes.

getStartTime()

public abstract Date getStartTime()

Gets the indexing start time.

Returns: java.util.Date - The indexing start time.

getEndTime()

public abstract Date getEndTime()

Gets the indexing end time.

Returns: java.util.Date - The indexing end time.

getIndexingTime()

public abstract double getIndexingTime()

Gets the indexing duration in seconds.

Returns: double - The indexing duration in seconds.

getErrors()

public abstract String[] getErrors()

Gets the list of errors.

Returns: java.lang.String[] - The list of errors.

getIndexedDocuments()

public abstract String[] getIndexedDocuments()

Gets the list of indexed documents.

Returns: java.lang.String[] - The list of indexed documents.

getUpdatedDocuments()

public abstract String[] getUpdatedDocuments()

Gets the list of updated documents.

Returns: java.lang.String[] - The list of updated documents.

getRemovedDocuments()

public abstract String[] getRemovedDocuments()

Gets the list of removed from index documents.

Returns: java.lang.String[] - The list of removed from index documents.