jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cki...@apache.org
Subject svn commit: r563673 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
Date Tue, 07 Aug 2007 21:57:06 GMT
Author: ckiehl
Date: Tue Aug  7 14:57:05 2007
New Revision: 563673

URL: http://svn.apache.org/viewvc?view=rev&rev=563673
Log:
JCR-1051: Patch applied as proposed by Ard Schrijvers.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java?view=diff&rev=563673&r1=563672&r2=563673
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java
Tue Aug  7 14:57:05 2007
@@ -153,13 +153,13 @@
         // otherwise calculate new
         docFilter = new BitSet(reader.maxDoc());
         // we match all terms
-        TermEnum terms = reader.terms(new Term(FieldNames.PROPERTIES, field));
+        TermEnum terms = reader.terms(new Term(FieldNames.PROPERTIES, FieldNames.createNamedValue(field,
"")));
         try {
             TermDocs docs = reader.termDocs();
             try {
                 while (terms.term() != null
                         && terms.term().field() == FieldNames.PROPERTIES
-                        && terms.term().text().startsWith(field)) {
+                        && terms.term().text().startsWith(FieldNames.createNamedValue(field,
""))) {
                     docs.seek(terms);
                     while (docs.next()) {
                         docFilter.set(docs.doc());

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java?view=diff&rev=563673&r1=563672&r2=563673
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
Tue Aug  7 14:57:05 2007
@@ -343,7 +343,9 @@
         foo.setProperty("mytext", "the quick brown fox jumps over the lazy dog.");
         Node bar = testRootNode.addNode("bar");
         bar.setProperty("text", "the quick brown fox jumps over the lazy dog.");
-
+        // documents which field name is not exactly "mytext" should not match (JCR-1051)
+        bar.setProperty("mytextwhichstartswithmytext", "the quick brown fox jumps over the
lazy dog.");
+        
         testRootNode.save();
 
         String sql = "SELECT * FROM nt:unstructured WHERE mytext is not null";



Mime
View raw message