X-Git-Url: https://git.mdrn.pl/pylucene.git/blobdiff_plain/a2e61f0c04805cfcb8706176758d1283c7e3a55c..aaeed5504b982cf3545252ab528713250aa33eed:/lucene-java-3.4.0/lucene/src/test/org/apache/lucene/search/TestTopDocsMerge.java diff --git a/lucene-java-3.4.0/lucene/src/test/org/apache/lucene/search/TestTopDocsMerge.java b/lucene-java-3.4.0/lucene/src/test/org/apache/lucene/search/TestTopDocsMerge.java deleted file mode 100644 index 63cc50b..0000000 --- a/lucene-java-3.4.0/lucene/src/test/org/apache/lucene/search/TestTopDocsMerge.java +++ /dev/null @@ -1,273 +0,0 @@ -package org.apache.lucene.search; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.apache.lucene.document.Document; -import org.apache.lucene.document.Field; -import org.apache.lucene.document.NumericField; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.RandomIndexWriter; -import org.apache.lucene.index.Term; -import org.apache.lucene.store.Directory; -import org.apache.lucene.util.LuceneTestCase; -import org.apache.lucene.util.ReaderUtil; -import org.apache.lucene.util._TestUtil; - -public class TestTopDocsMerge extends LuceneTestCase { - - private static class ShardSearcher { - private final IndexSearcher subSearcher; - - public ShardSearcher(IndexReader subReader) { - this.subSearcher = new IndexSearcher(subReader); - } - - public void search(Weight weight, Collector collector) throws IOException { - subSearcher.search(weight, null, collector); - } - - public TopDocs search(Weight weight, int topN) throws IOException { - return subSearcher.search(weight, null, topN); - } - - @Override - public String toString() { - return "ShardSearcher(" + subSearcher + ")"; - } - } - - public void testSort() throws Exception { - - IndexReader reader = null; - Directory dir = null; - - final int numDocs = atLeast(1000); - //final int numDocs = atLeast(50); - - final String[] tokens = new String[] {"a", "b", "c", "d", "e"}; - - if (VERBOSE) { - System.out.println("TEST: make index"); - } - - { - dir = newDirectory(); - final RandomIndexWriter w = new RandomIndexWriter(random, dir); - // w.setDoRandomOptimize(false); - - // w.w.getConfig().setMaxBufferedDocs(atLeast(100)); - - final String[] content = new String[atLeast(20)]; - - for(int contentIDX=0;contentIDX docFieldLocs = new ArrayList(); - if (hits instanceof TopFieldDocs) { - TopFieldDocs fieldHits = (TopFieldDocs) hits; - for(int fieldIDX=0;fieldIDX