jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r695969 - in /jackrabbit/branches/1.4/jackrabbit-core: ./ src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
Date Tue, 16 Sep 2008 16:34:23 GMT
Author: jukka
Date: Tue Sep 16 09:34:22 2008
New Revision: 695969

URL: http://svn.apache.org/viewvc?rev=695969&view=rev
Log:
1.4: Merged revision 682409 (JCR-1704)

Modified:
    jackrabbit/branches/1.4/jackrabbit-core/   (props changed)
    jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java

Propchange: jackrabbit/branches/1.4/jackrabbit-core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 16 09:34:22 2008
@@ -1 +1 @@
-/jackrabbit/trunk/jackrabbit-core:653417,654078,654514,655917,656240,656655,656664,658583,668147,672125,679389,680135,681031,681287,686688,691550,694164
+/jackrabbit/trunk/jackrabbit-core:653417,654078,654514,655917,656240,656655,656664,658583,668147,672125,679389,680135,681031,681287,682409,686688,691550,694164

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java?rev=695969&r1=695968&r2=695969&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
Tue Sep 16 09:34:22 2008
@@ -124,15 +124,16 @@
             if (configNode.getNodeName().equals("index-rule")) {
                 IndexingRule element = new IndexingRule(configNode);
                 // register under node type and all its sub types
+                log.debug("Found rule '{}' for NodeType '{}'", element, element.getNodeTypeName());
                 for (int n = 0; n < ntNames.length; n++) {
-                    if (ntReg.getEffectiveNodeType(ntNames[n]).includesNodeType(
-                            element.getNodeTypeName())) {
+                    if (ntReg.getEffectiveNodeType(ntNames[n]).includesNodeType(element.getNodeTypeName()))
{
                         List perNtConfig = (List) configElements.get(ntNames[n]);
                         if (perNtConfig == null) {
                             perNtConfig = new ArrayList();
                             configElements.put(ntNames[n], perNtConfig);
                         }
-                        perNtConfig.add(element);
+                        log.debug("Registering it for name '{}'", ntNames[n]);
+                        perNtConfig.add(new IndexingRule(element, ntNames[n]));
                     }
                 }
             } else if (configNode.getNodeName().equals("aggregate")) {
@@ -511,6 +512,20 @@
         private final float boost;
 
         /**
+         * Creates a new indexing rule base on an existing one, but for a
+         * different node type name.
+         *
+         * @param original the existing rule.
+         * @param nodeTypeName the node type name for the rule.
+         */
+        IndexingRule(IndexingRule original, Name nodeTypeName) {
+            this.nodeTypeName = nodeTypeName;
+            this.propConfigs = original.propConfigs;
+            this.condition = original.condition;
+            this.boost = original.boost;
+        }
+
+        /**
          *
          * @param config the configuration for this rule.
          * @throws MalformedPathException if the condition expression is malformed.



Mime
View raw message