jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r831117 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Date Thu, 29 Oct 2009 22:15:38 GMT
Author: mreutegg
Date: Thu Oct 29 22:15:38 2009
New Revision: 831117

URL: http://svn.apache.org/viewvc?rev=831117&view=rev
Log:
JCR-2370: Index recovery may fail when redo log contains nodes that are part of an index aggregate

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=831117&r1=831116&r2=831117&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Thu Oct 29 22:15:38 2009
@@ -1103,7 +1103,7 @@
         indexer.setIndexingConfiguration(indexingConfig);
         indexer.setIndexFormatVersion(indexFormatVersion);
         Document doc = indexer.createDoc();
-        mergeAggregatedNodeIndexes(node, doc);
+        mergeAggregatedNodeIndexes(node, doc, indexFormatVersion);
         return doc;
     }
 
@@ -1321,8 +1321,11 @@
      *
      * @param state the node state on which <code>doc</code> was created.
      * @param doc the lucene document with index fields from <code>state</code>.
+     * @param ifv the current index format version.
      */
-    protected void mergeAggregatedNodeIndexes(NodeState state, Document doc) {
+    protected void mergeAggregatedNodeIndexes(NodeState state,
+                                              Document doc,
+                                              IndexFormatVersion ifv) {
         if (indexingConfig != null) {
             AggregateRule[] aggregateRules = indexingConfig.getAggregateRules();
             if (aggregateRules == null) {
@@ -1337,7 +1340,7 @@
                     if (aggregates != null) {
                         ruleMatched = true;
                         for (NodeState aggregate : aggregates) {
-                            Document aDoc = createDocument(aggregate, getNamespaceMappings(),
index.getIndexFormatVersion());
+                            Document aDoc = createDocument(aggregate, getNamespaceMappings(),
ifv);
                             // transfer fields to doc if there are any
                             Fieldable[] fulltextFields = aDoc.getFieldables(FieldNames.FULLTEXT);
                             if (fulltextFields != null) {
@@ -1355,7 +1358,7 @@
                         for (PropertyState propState : propStates) {
                             String namePrefix = FieldNames.createNamedValue(getNamespaceMappings().translateName(propState.getName()),
"");
                             NodeState parent = (NodeState) ism.getItemState(propState.getParentId());
-                            Document aDoc = createDocument(parent, getNamespaceMappings(),
getIndex().getIndexFormatVersion());
+                            Document aDoc = createDocument(parent, getNamespaceMappings(),
ifv);
                             try {
                                 // find the right fields to transfer
                                 Fieldable[] fields = aDoc.getFieldables(FieldNames.PROPERTIES);



Mime
View raw message