jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1497250 - in /jackrabbit/branches/2.6: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-core/src/test/repository/workspaces/indexing...
Date Thu, 27 Jun 2013 08:54:17 GMT
Author: reschke
Date: Thu Jun 27 08:54:17 2013
New Revision: 1497250

URL: http://svn.apache.org/r1497250
Log:
JCR-3610: html excerpt broken when one of the indexed properties contains markup (ported to
2.6)

Modified:
    jackrabbit/branches/2.6/   (props changed)
    jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
    jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingRuleTest.java
    jackrabbit/branches/2.6/jackrabbit-core/src/test/repository/workspaces/indexing-test/indexing-configuration.xml

Propchange: jackrabbit/branches/2.6/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1497243

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java?rev=1497250&r1=1497249&r2=1497250&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
Thu Jun 27 08:54:17 2013
@@ -118,24 +118,6 @@ public abstract class AbstractExcerpt im
                 }
                 text.append(separator);
                 text.append(fields[i].stringValue());
-                // this is a hack! in general multiple fields with the same
-                // name are handled properly, that is, offset and position is
-                // calculated correctly. there is one case however where
-                // the offset gets wrong:
-                // if a term text ends with characters that are considered noise
-                // then the offset of the next field will be off by the number
-                // of noise characters.
-                // therefore we delete noise characters at the end of the text.
-                // this process is required for all but the last field
-                if (i < fields.length - 1) {
-                    for (int j = text.length() - 1; j >= 0; j--) {
-                        if (Character.isLetterOrDigit(text.charAt(j))) {
-                            break;
-                        } else {
-                            text.deleteCharAt(j);
-                        }
-                    }
-                }
                 separator = " ";
             }
             TermFreqVector tfv = reader.getTermFreqVector(

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingRuleTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingRuleTest.java?rev=1497250&r1=1497249&r2=1497250&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingRuleTest.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexingRuleTest.java
Thu Jun 27 08:54:17 2013
@@ -95,6 +95,8 @@ public class IndexingRuleTest extends Ab
         Node node = testRootNode.addNode(nodeName1, NT_UNSTRUCTURED);
         node.setProperty("rule", "excerpt");
         node.setProperty("title", "Apache Jackrabbit");
+        // the value below is for testing https://issues.apache.org/jira/browse/JCR-3610
+        node.setProperty("foo", "<some>markup</some>");
         node.setProperty("text", "Jackrabbit is a JCR implementation");
         testRootNode.save();
         String stmt = "/jcr:root" + testRootNode.getPath() +

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/test/repository/workspaces/indexing-test/indexing-configuration.xml
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/test/repository/workspaces/indexing-test/indexing-configuration.xml?rev=1497250&r1=1497249&r2=1497250&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/test/repository/workspaces/indexing-test/indexing-configuration.xml
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/test/repository/workspaces/indexing-test/indexing-configuration.xml
Thu Jun 27 08:54:17 2013
@@ -34,6 +34,7 @@
 
     <index-rule nodeType="nt:unstructured" condition="@rule='excerpt'">
         <property useInExcerpt="false">title</property>
+        <property>foo</property><!-- needed to test JCR-3610 -->
         <property>text</property>
     </index-rule>
 



Mime
View raw message