score:1
Accepted answer
i don't see any constants you could use in pdftextstream
. it would, however, be pretty simple to add it directly to the lucene document that is generated by pdfdocumentfactory
before adding it to the index:
doc= pdfdocumentfactory.buildpdfdocument(file, config);
doc.addfield(new stringfield("path", file.getpath(), field.store.yes));
system.out.println(doc.get("path"));
writer.adddocument(doc);
you may want to use a different field type, depending on your needs (stringfield
for exact matching, textfield
for full text search, storedfield
for no searching on that field)
Source: stackoverflow.com
Related Query
- How the get the filepath of a document in setFieldName of PDFTextStream?
- How do I set ${user} in Eclipse to get the correct @author tag?
- shortcut : how to get eclipse to go to the ONLY implementation of an interface's method
- How can I get Eclipse to scroll past the bottom of the document?
- How can I get the "Eclipse >Generate>Jaxb classes" option back?
- How can I get relative path of the folders in my android project?
- How can I get Eclipse 2018.09 to use the JUnit 4 test runner by default?
- How do I get verbose output from Maven in the Eclipse console?
- How do I get Eclipse to show the entire javadoc for a class
- How to get rid of the warning: Use '$' instead of '.' for inner classes in Eclipse
- How do I get Logcat for multiple devices running at the same time in Eclipse
- How do I get the old colors and look & feel back in Eclipse 4.2?
- How to get the Android API documentation in Eclipse
- How do I get the workbench window to open a modal dialog in an Eclipse based project?
- How do I get the command-line for an Eclipse run configuration?
- How to get the graphical layout Window back in Eclipse for Android Application Design?
- How to get the selected node in the package explorer from an Eclipse plugin
- How do I get to the command line in Eclipse
- How do you get the fully qualified class name in Eclipse?
- How to get the user preferred units? (metric (meters) or imperial (miles))?
- Eclipse Plugin: how to get the path to the currently selected project
- How can I get the complete Call Hierarchy of a Java source code?
- How to get the inline command launch by eclipse
- How to get pylint warnings to be marked in the Pydev Eclipse editor margin?
- How do I get the current method from the active Eclipse editor?
- How can I get the project path in Scala?
- How do I get the caller(s) of a method without running this system (written in JAVA)
- How to get Eclipse to give Cygwin's GDB a posix path to the executable?
- In eclipse, how do I get the debugger to show all stack frames without clicking expand on each of the threads?
- How do I get the "referenced libraries" folder back In the eclipse sdk?
More Query from same tag
- Receiving simple parameters with webservice
- Eclipse 4.2.1 - Avd running but not receiving app
- How to associate an Eclipse perspective to a file type?
- Referencing Ecore Eclasses. Is it possible to reference eClasses from xmi instances?
- Unable to add breakpoint in eclipse+FDT
- Eclipse fragment not resoving classes in parent plugin
- Line feeds in Eclipse layout XML
- Migrate to Android Studio from Eclipse without Gradle
- Efficient OSGi development workflow
- PlayN showcase-html validation issue
- Remove jdt dependencies from XTEXT 2.0 project
- Eclipse CDT, build settings - Hello World
- android gps how to display current position
- Configuring C/C++ on eclipse on Fedora
- how convert a java project to maven
- What is pure OSGi equvalent for Eclipse Platform.getBundle()
- How do I reduce the two-tab indent of multi-line statements to one tab in Eclipse?
- how to use ant-contrib tasks in eclipse auto content assist
- Eclipse Code Formatter indents with double amount of spaces - Intellij IDE
- Mac OS X Lion has no /Developer/usr folder
- maven-jaxb2-plugin issue with Eclipse Kepler
- run same project in parallel using eclipse
- Qt Jambi Javadoc missing
- Can“t use JFrame in Eclipse for mac
- Eclipse GMF/GEF different Figures
- Configuring SVN from PKCS12 files
- How to set up Apache Tomcat 8 to run a servlet application on HTTPS
- Android - Unable to find explicit activity class
- Getting started with unit testing for c++ in eclipse on Ubuntu
- Create BAT- and JAR-files from input of JAR-file