incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Fixed BLUR-418
Date Mon, 16 Mar 2015 12:37:13 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master 183f8451a -> a68cb49eb


Fixed BLUR-418


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/a68cb49e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/a68cb49e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/a68cb49e

Branch: refs/heads/master
Commit: a68cb49eb07571998a59bb289450732b94962217
Parents: 183f845
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Mar 16 08:37:12 2015 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Mar 16 08:37:12 2015 -0400

----------------------------------------------------------------------
 .../apache/blur/lucene/search/BlurQueryParser.java   |  1 +
 .../apache/blur/lucene/search/SuperParserTest.java   | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a68cb49e/blur-query/src/main/java/org/apache/blur/lucene/search/BlurQueryParser.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/lucene/search/BlurQueryParser.java b/blur-query/src/main/java/org/apache/blur/lucene/search/BlurQueryParser.java
index 587bb2f..c68ae2a 100644
--- a/blur-query/src/main/java/org/apache/blur/lucene/search/BlurQueryParser.java
+++ b/blur-query/src/main/java/org/apache/blur/lucene/search/BlurQueryParser.java
@@ -43,6 +43,7 @@ public class BlurQueryParser extends QueryParser {
     super(matchVersion, f, fieldManager.getAnalyzerForQuery());
     _fieldNames = fieldNames == null ? new HashMap<Query, String>() : fieldNames;
     _fieldManager = fieldManager;
+    setAllowLeadingWildcard(true);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/a68cb49e/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java b/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java
index 970f84d..73a889b 100644
--- a/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java
+++ b/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java
@@ -49,6 +49,7 @@ import org.apache.lucene.search.NumericRangeQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TermRangeQuery;
+import org.apache.lucene.search.WildcardQuery;
 import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree;
 import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
 import org.apache.lucene.spatial.query.SpatialArgs;
@@ -491,6 +492,20 @@ public class SuperParserTest {
     assertQuery(bq, q);
   }
 
+  @Test
+  public void test41() throws ParseException {
+    Query q = parseSq("<*>");
+    Query q1 = sq(new MatchAllDocsQuery());
+    assertQuery(q1, q);
+  }
+
+  @Test
+  public void test42() throws ParseException {
+    Query q = parseSq("<f.c:*abc>");
+    Query q1 = sq(new WildcardQuery(new Term("f.c", "*abc")));
+    assertQuery(q1, q);
+  }
+
   public static BooleanClause bc_m(Query q) {
     return new BooleanClause(q, Occur.MUST);
   }


Mime
View raw message