jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r577816 - in /jackrabbit/branches/1.3/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
Date Thu, 20 Sep 2007 17:11:25 GMT
Author: jukka
Date: Thu Sep 20 10:11:25 2007
New Revision: 577816

URL: http://svn.apache.org/viewvc?rev=577816&view=rev
Log:
1.3: Merged revisions 563673 and 565316 (JCR-1051)

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

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java?rev=577816&r1=577815&r2=577816&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MatchAllScorer.java
Thu Sep 20 10:11:25 2007
@@ -153,13 +153,14 @@
         // otherwise calculate new
         docFilter = new BitSet(reader.maxDoc());
         // we match all terms
-        TermEnum terms = reader.terms(new Term(FieldNames.PROPERTIES, field));
+        String namedValue = FieldNames.createNamedValue(field, "");
+        TermEnum terms = reader.terms(new Term(FieldNames.PROPERTIES, namedValue));
         try {
             TermDocs docs = reader.termDocs();
             try {
                 while (terms.term() != null
                         && terms.term().field() == FieldNames.PROPERTIES
-                        && terms.term().text().startsWith(field)) {
+                        && terms.term().text().startsWith(namedValue)) {
                     docs.seek(terms);
                     while (docs.next()) {
                         docFilter.set(docs.doc());

Modified: jackrabbit/branches/1.3/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java?rev=577816&r1=577815&r2=577816&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SimpleQueryTest.java
Thu Sep 20 10:11:25 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