jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1412910 - /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadWriteOakDirectory.java
Date Fri, 23 Nov 2012 15:17:01 GMT
Author: alexparvulescu
Date: Fri Nov 23 15:17:00 2012
New Revision: 1412910

URL: http://svn.apache.org/viewvc?rev=1412910&view=rev
Log:
OAK-154 Full text search index
 - added node types to the index nodes, to prevent a NPE in the node type validation code

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

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadWriteOakDirectory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadWriteOakDirectory.java?rev=1412910&r1=1412909&r2=1412910&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadWriteOakDirectory.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/ReadWriteOakDirectory.java
Fri Nov 23 15:17:00 2012
@@ -18,11 +18,14 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.io.IOException;
 
+import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.IndexOutput;
 
+import static org.apache.jackrabbit.JcrConstants.*;
+
 /**
  * A red-write implementation of the Lucene {@link Directory} (a flat list of
  * files) that allows to store Lucene index content in an Oak repository.
@@ -31,6 +34,7 @@ public class ReadWriteOakDirectory exten
 
     public ReadWriteOakDirectory(NodeBuilder directoryBuilder) {
         super(directoryBuilder);
+        this.directoryBuilder.setProperty(JCR_PRIMARYTYPE, NT_UNSTRUCTURED, Type.NAME);
     }
 
     @Override
@@ -54,6 +58,8 @@ public class ReadWriteOakDirectory exten
             this.buffer = readFile(name);
             this.size = buffer.length;
             this.position = 0;
+            directoryBuilder.child(name).setProperty(JCR_PRIMARYTYPE,
+                    NT_UNSTRUCTURED, Type.NAME);
         }
 
         @Override



Mime
View raw message