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

git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@375308 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2006-02-06 16:24:21 +00:00
parent 1ba72bdb16
commit 00de122b8f
3 changed files with 10 additions and 60 deletions

View File

@ -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>
</project>

View File

@ -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()) {

View File

@ -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);
}
}