Permalink
Browse files

support new Tika 0.8 DATE Property.

  • Loading branch information...
1 parent 80c8afe commit 1bec5af566bab633bd9dcfdf1aebd48c84005fc1 Robert Newson committed Nov 25, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/main/java/com/github/rnewson/couchdb/lucene/Tika.java
@@ -28,6 +28,7 @@
import org.apache.tika.metadata.DublinCore;
import org.apache.tika.metadata.HttpHeaders;
import org.apache.tika.metadata.Metadata;
+import org.apache.tika.metadata.Property;
public final class Tika {
@@ -68,6 +69,12 @@ private void addAttribute(final String namespace, final String attributeName, fi
}
}
+ private void addAttribute(final String namespace, final Property property, final Metadata md, final Document doc) {
+ if (md.get(property) != null) {
+ doc.add(text(namespace + property.getName(), md.get(property), false));
+ }
+ }
+
private void addDublinCoreAttributes(final Metadata md, final Document doc) {
addAttribute(DC, DublinCore.CONTRIBUTOR, md, doc);
addAttribute(DC, DublinCore.COVERAGE, md, doc);

0 comments on commit 1bec5af

Please sign in to comment.