You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by al...@apache.org on 2014/10/21 10:47:26 UTC

svn commit: r1633315 - /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java

Author: alexparvulescu
Date: Tue Oct 21 08:47:26 2014
New Revision: 1633315

URL: http://svn.apache.org/r1633315
Log:
OAK-2221 Log path for text extraction error on the Lucene index

Modified:
    jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java?rev=1633315&r1=1633314&r2=1633315&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java (original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java Tue Oct 21 08:47:26 2014
@@ -226,7 +226,7 @@ public class LuceneIndexEditor implement
 
                 if (Type.BINARY.tag() == property.getType().tag()) {
                     this.context.indexUpdate();
-                    fields.addAll(newBinary(property, state));
+                    fields.addAll(newBinary(property, state, path + "@" + pname));
                     dirty = true;
                 } else if(!context.isFullTextEnabled()
                         && FieldFactory.canCreateTypedField(property.getType())){
@@ -334,7 +334,7 @@ public class LuceneIndexEditor implement
     }
 
     private List<Field> newBinary(
-            PropertyState property, NodeState state) {
+            PropertyState property, NodeState state, String path) {
         List<Field> fields = new ArrayList<Field>();
         Metadata metadata = new Metadata();
         if (JCR_DATA.equals(property.getName())) {
@@ -349,12 +349,12 @@ public class LuceneIndexEditor implement
         }
 
         for (Blob v : property.getValue(Type.BINARIES)) {
-            fields.add(newFulltextField(parseStringValue(v, metadata)));
+            fields.add(newFulltextField(parseStringValue(v, metadata, path)));
         }
         return fields;
     }
 
-    private String parseStringValue(Blob v, Metadata metadata) {
+    private String parseStringValue(Blob v, Metadata metadata, String path) {
         WriteOutContentHandler handler = new WriteOutContentHandler();
         try {
             InputStream stream = v.getNewStream();
@@ -372,7 +372,8 @@ public class LuceneIndexEditor implement
             // Capture and report any other full text extraction problems.
             // The special STOP exception is used for normal termination.
             if (!handler.isWriteLimitReached(t)) {
-                log.debug("Failed to extract text from a binary property."
+                log.debug("Failed to extract text from a binary property: "
+                        + path
                         + " This is a fairly common case, and nothing to"
                         + " worry about. The stack trace is included to"
                         + " help improve the text extraction feature.", t);