Class IndexPDFFiles
java.lang.Object
org.apache.pdfbox.examples.lucene.IndexPDFFiles
Index all pdf files under a directory.
This is a command-line application demonstrating simple Lucene indexing. Run it with no command-line arguments for usage information.
It's based on a demo provided by the lucene project.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidIndexes the given file using the given writer, or if a directory is given, recurses over files and directories found under the given directory.static voidIndex all text files under a directory.
-
Constructor Details
-
IndexPDFFiles
private IndexPDFFiles()
-
-
Method Details
-
main
Index all text files under a directory.- Parameters:
args- command line arguments
-
indexDocs
Indexes the given file using the given writer, or if a directory is given, recurses over files and directories found under the given directory. NOTE: This method indexes one document per input file. This is slow. For good throughput, put multiple documents into your input file(s). An example of this is in the benchmark module, which can create "line doc" files, one document per line, using the WriteLineDocTask.- Parameters:
writer- Writer to the index where the given file/dir info will be storedfile- The file to index, or the directory to recurse into to find files to index- Throws:
IOException- If there is a low-level I/O error
-