Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

remove lucene package and lucene_extras dir, FieldSortedHitQueue is now public in lucene.

Yonik Seeley00de122b8f07
diff --git a/build.xml b/build.xml
index abb2466ca7d..ebca302bbce 100644
--- a/build.xml
+++ b/build.xml
@@ -43,10 +43,7 @@
<!-- The compilation classpath -->
<path id="compile.classpath">
<fileset dir="${lib}">
- <include name="lucene-core-nightly.jar" />
- <include name="lucene-snowball-nightly.jar" />
- <include name="servlet-api-2.4.jar" />
- <include name="xpp3-1.1.3.4.O.jar" />
+ <include name="*.jar" />
</fileset>
</path>
@@ -60,14 +57,6 @@
<src path="${src}/java" />
<src path="${src}/webapp" />
- <!-- This dir includes tests, but is needed by core: need to split these up -->
- <!-- A better name for this directory is needed anyways. -->
- <src path="${src}/lucene_extras" >
- </src>
-
- <!-- Only need this for now because lucene_extras has a test class -->
- <exclude name="**/Test*" />
-
</javac>
</target>
@@ -123,7 +112,7 @@
webxml="${src}/webapp/WEB-INF/web.xml">
<classes dir="${dest}" />
<lib dir="${lib}">
- <exclude name="servlet-api-2.4.jar" />
+ <exclude name="servlet-api-*.jar" />
</lib>
@@ -150,7 +139,7 @@
basedir="${dest}" />
<zip destfile="${dist}/${ant.project.name}-${version}.zip"
- basedir="${dist}" />
+ basedir="${dest}" />
</target>
-</project>
\ No newline at end of file
+</project>
diff --git a/src/java/org/apache/solr/search/SolrIndexSearcher.java b/src/java/org/apache/solr/search/SolrIndexSearcher.java
index e63694bb7f0..a51546448f9 100644
--- a/src/java/org/apache/solr/search/SolrIndexSearcher.java
+++ b/src/java/org/apache/solr/search/SolrIndexSearcher.java
@@ -696,17 +696,19 @@ public class SolrIndexSearcher extends Searcher implements SolrInfoMBean {
// NOTE: this changed late in Lucene 1.9
final DocSet filt = filter;
- final PublicFieldSortedHitQueue hq = new PublicFieldSortedHitQueue(reader, lsort.getSort(), offset+len);
+ final int[] numHits = new int[1];
+ final FieldSortedHitQueue hq = new FieldSortedHitQueue(reader, lsort.getSort(), offset+len);
searcher.search(query, new HitCollector() {
public void collect(int doc, float score) {
if (filt!=null && !filt.exists(doc)) return;
+ numHits[0]++;
hq.insert(new FieldDoc(doc, score));
}
}
);
- totalHits = hq.getTotalHits();
+ totalHits = numHits[0];
maxScore = totalHits>0 ? hq.getMaxScore() : 0.0f;
nDocsReturned = hq.size();
@@ -916,8 +918,8 @@ public class SolrIndexSearcher extends Searcher implements SolrInfoMBean {
protected DocList sortDocSet(DocSet set, Sort sort, int nDocs) throws IOException {
- final PublicFieldSortedHitQueue hq =
- new PublicFieldSortedHitQueue(reader, sort.getSort(), nDocs);
+ final FieldSortedHitQueue hq =
+ new FieldSortedHitQueue(reader, sort.getSort(), nDocs);
DocIterator iter = set.iterator();
int hits=0;
while(iter.hasNext()) {
diff --git a/src/lucene_extras/org/apache/lucene/search/PublicFieldSortedHitQueue.java b/src/lucene_extras/org/apache/lucene/search/PublicFieldSortedHitQueue.java
deleted file mode 100644
index cc0b36f99d8..00000000000
--- a/src/lucene_extras/org/apache/lucene/search/PublicFieldSortedHitQueue.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright 2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.lucene.search;
-
-/**
- * FieldSortedHitQueue that is public (can be created and accessed from other packages)
- *
- * @author yonik
- * @version $Id: PublicFieldSortedHitQueue.java,v 1.3 2005/11/11 21:57:56 yonik Exp $
- */
-
-import org.apache.lucene.index.IndexReader;
-import java.io.IOException;
-
-public class PublicFieldSortedHitQueue extends FieldSortedHitQueue {
- public PublicFieldSortedHitQueue (IndexReader reader, SortField[] fields, int size) throws IOException {
- super(reader, fields, size);
- }
-
- int totalHits;
- public int getTotalHits() { return totalHits; }
-
- public boolean insert(FieldDoc element) {
- totalHits++;
- return super.insert(element);
- }
-}
\ No newline at end of file