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 11:48:55 UTC
svn commit: r1633332 - in /jackrabbit/oak/branches/1.0: ./
oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
Author: alexparvulescu
Date: Tue Oct 21 09:48:55 2014
New Revision: 1633332
URL: http://svn.apache.org/r1633332
Log:
OAK-2221 Log path for text extraction error on the Lucene index
- merged rev r1633315
Modified:
jackrabbit/oak/branches/1.0/ (props changed)
jackrabbit/oak/branches/1.0/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
Propchange: jackrabbit/oak/branches/1.0/
------------------------------------------------------------------------------
Merged /jackrabbit/oak/trunk:r1633315
Modified: jackrabbit/oak/branches/1.0/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java?rev=1633332&r1=1633331&r2=1633332&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java (original)
+++ jackrabbit/oak/branches/1.0/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java Tue Oct 21 09:48:55 2014
@@ -200,7 +200,7 @@ public class LuceneIndexEditor implement
.tag())) != 0 && context.includeProperty(pname)) {
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 {
for (String value : property.getValue(Type.STRINGS)) {
@@ -236,7 +236,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())) {
@@ -251,12 +251,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();
@@ -274,7 +274,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);