Apache Lucene open-source search software
Upgraded to Lucene 2.9-dev r768228 Fixes for changes in trie introduced with LUCENE-1602 Implemented SolrIndexSearcher#search(Weight, Filter, Collector) to fix compile error
Shalin Shekhar Mangar31b15cbb233b
diff --git a/CHANGES.txt b/CHANGES.txtindex aad8eccf38b..5bb8fca3b39 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -402,6 +402,8 @@ Other Changes26. SOLR-804: Added Lucene's misc contrib JAR (rev 764281). (gsingers)+27. Upgraded to Lucene 2.9-dev r768228 (shalin)+Build----------------------1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers)diff --git a/lib/lucene-analyzers-2.9-dev.jar b/lib/lucene-analyzers-2.9-dev.jarindex 6a3db216cee..1c97075a401 100644--- a/lib/lucene-analyzers-2.9-dev.jar+++ b/lib/lucene-analyzers-2.9-dev.jar@@ -1,2 +1,2 @@-AnyObjectId[7d13c44721860aef7c2ea9b17b2b4cbac98cf6f7] was removed in git history.+AnyObjectId[428a55fe75dbf4220bcabf342fb0fa921f32695e] was removed in git history.Apache SVN contains full history.\ No newline at end of filediff --git a/lib/lucene-core-2.9-dev.jar b/lib/lucene-core-2.9-dev.jarindex 984be13c379..d6d3923395b 100644--- a/lib/lucene-core-2.9-dev.jar+++ b/lib/lucene-core-2.9-dev.jar@@ -1,2 +1,2 @@-AnyObjectId[04bc7ae6e6cc343ade7e43bf42b3bce97d9e5954] was removed in git history.+AnyObjectId[d050ce600994d982e429d6605d499c4faf386bfd] was removed in git history.Apache SVN contains full history.\ No newline at end of filediff --git a/lib/lucene-highlighter-2.9-dev.jar b/lib/lucene-highlighter-2.9-dev.jarindex 1158bac5f6a..df297c709f8 100644--- a/lib/lucene-highlighter-2.9-dev.jar+++ b/lib/lucene-highlighter-2.9-dev.jar@@ -1,2 +1,2 @@-AnyObjectId[6a686abf403738ec93b9e8b7de66878ed0aee14d] was removed in git history.+AnyObjectId[e6a55b2a71b79730eb1e476070a60c5ad659c09a] was removed in git history.Apache SVN contains full history.\ No newline at end of filediff --git a/lib/lucene-memory-2.9-dev.jar b/lib/lucene-memory-2.9-dev.jarindex db0deb3bb7d..409fc2a5121 100644--- a/lib/lucene-memory-2.9-dev.jar+++ b/lib/lucene-memory-2.9-dev.jar@@ -1,2 +1,2 @@-AnyObjectId[9664195864691ffb40bb729ea581f7ec8644497a] was removed in git history.+AnyObjectId[fcdd0eeef36a6c7bb4c32904049f52994ff40d61] was removed in git history.Apache SVN contains full history.\ No newline at end of filediff --git a/lib/lucene-queries-2.9-dev.jar b/lib/lucene-queries-2.9-dev.jarindex 53967659045..7f213a152a4 100644--- a/lib/lucene-queries-2.9-dev.jar+++ b/lib/lucene-queries-2.9-dev.jar@@ -1,2 +1,2 @@-AnyObjectId[26ab10a447cb308f1f139087d031c378a84ff635] was removed in git history.+AnyObjectId[ce1de363884f2b7bf8da4744e9ac044d647cb8d0] was removed in git history.Apache SVN contains full history.\ No newline at end of filediff --git a/lib/lucene-snowball-2.9-dev.jar b/lib/lucene-snowball-2.9-dev.jarindex 68a15ba81ae..6c41888342b 100644--- a/lib/lucene-snowball-2.9-dev.jar+++ b/lib/lucene-snowball-2.9-dev.jar@@ -1,2 +1,2 @@-AnyObjectId[e3d36c294abda52c7fa7598c1f614ff0aa7594ad] was removed in git history.+AnyObjectId[744a96d3fb652fc9cf997fcf5284da15a06fcf7a] was removed in git history.Apache SVN contains full history.\ No newline at end of filediff --git a/lib/lucene-spellchecker-2.9-dev.jar b/lib/lucene-spellchecker-2.9-dev.jarindex 5753a841779..3cb36e1fd9a 100644--- a/lib/lucene-spellchecker-2.9-dev.jar+++ b/lib/lucene-spellchecker-2.9-dev.jar@@ -1,2 +1,2 @@-AnyObjectId[2c189b0b4f45bddd0f307ce73bc670e22a7a3c26] was removed in git history.+AnyObjectId[dba82cdd918a35fb96595591d8ad578035eb4fb7] was removed in git history.Apache SVN contains full history.\ No newline at end of filediff --git a/src/java/org/apache/solr/schema/TrieField.java b/src/java/org/apache/solr/schema/TrieField.javaindex 222a5e15137..45b85c1d67d 100644--- a/src/java/org/apache/solr/schema/TrieField.java+++ b/src/java/org/apache/solr/schema/TrieField.java@@ -17,12 +17,10 @@package org.apache.solr.schema;import org.apache.lucene.document.Fieldable;-import org.apache.lucene.search.Filter;-import org.apache.lucene.search.SortField;import org.apache.lucene.search.Query;-import org.apache.lucene.search.ConstantScoreQuery;-import org.apache.lucene.search.trie.IntTrieRangeFilter;-import org.apache.lucene.search.trie.LongTrieRangeFilter;+import org.apache.lucene.search.SortField;+import org.apache.lucene.search.trie.IntTrieRangeQuery;+import org.apache.lucene.search.trie.LongTrieRangeQuery;import org.apache.lucene.search.trie.TrieUtils;import org.apache.solr.analysis.*;import org.apache.solr.common.SolrException;@@ -42,9 +40,7 @@ import java.util.Map;* link. The possible number of terms increases dramatically with higher precision steps (factor 2^precisionStep). For* the fast range search to work, trie fields must be indexed.* <p/>- * Trie fields are <b>not</b> sortable in numerical order. Also, they cannot be used in function queries. If one needs- * sorting as well as fast range search, one should create a copy field specifically for sorting. Same workaround is- * suggested for using trie fields in function queries as well.+ * Trie fields are sortable in numerical order and can be used in function queries.* <p/>* Note that if you use a precisionStep of 32 for int/float and 64 for long/double, then multiple terms will not be* generated, range search will be no faster than any other number field, but sorting will be possible.@@ -171,39 +167,39 @@ public class TrieField extends FieldType {Query query = null;switch (type) {case INTEGER:- query = new IntTrieRangeFilter(field, precisionStep,+ query = new IntTrieRangeQuery(field, precisionStep,min == null ? null : Integer.parseInt(min),max == null ? null : Integer.parseInt(max),- minInclusive, maxInclusive).asQuery();+ minInclusive, maxInclusive);break;case FLOAT:- query = new IntTrieRangeFilter(field, precisionStep,+ query = new IntTrieRangeQuery(field, precisionStep,min == null ? null : TrieUtils.floatToSortableInt(Float.parseFloat(min)),max == null ? null : TrieUtils.floatToSortableInt(Float.parseFloat(max)),- minInclusive, maxInclusive).asQuery();+ minInclusive, maxInclusive);break;case LONG:- query = new LongTrieRangeFilter(field, precisionStep,+ query = new LongTrieRangeQuery(field, precisionStep,min == null ? null : Long.parseLong(min),max == null ? null : Long.parseLong(max),- minInclusive, maxInclusive).asQuery();+ minInclusive, maxInclusive);break;case DOUBLE:- query = new LongTrieRangeFilter(field, precisionStep,+ query = new LongTrieRangeQuery(field, precisionStep,min == null ? null : TrieUtils.doubleToSortableLong(Double.parseDouble(min)),max == null ? null : TrieUtils.doubleToSortableLong(Double.parseDouble(max)),- minInclusive, maxInclusive).asQuery();+ minInclusive, maxInclusive);break;case DATE:- query = new LongTrieRangeFilter(field, precisionStep,+ query = new LongTrieRangeQuery(field, precisionStep,min == null ? null : dateField.parseMath(null, min).getTime(),max == null ? null : dateField.parseMath(null, max).getTime(),- minInclusive, maxInclusive).asQuery();+ minInclusive, maxInclusive);break;default:throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field");}-+return query;}diff --git a/src/java/org/apache/solr/search/SolrIndexSearcher.java b/src/java/org/apache/solr/search/SolrIndexSearcher.javaindex d6a4ddfa03a..bfb30cf4cf8 100644--- a/src/java/org/apache/solr/search/SolrIndexSearcher.java+++ b/src/java/org/apache/solr/search/SolrIndexSearcher.java@@ -497,6 +497,10 @@ public class SolrIndexSearcher extends Searcher implements SolrInfoMBean {searcher.search(weight, filter, hitCollector);}+ public void search(Weight weight, Filter filter, Collector collector) throws IOException {+ searcher.search(weight, filter, collector);+ }+public Query rewrite(Query original) throws IOException {return searcher.rewrite(original);}