mirror of https://github.com/apache/lucene.git
Optimize the test index as preparation for LUCENE-1483, because the statistics on visited terms in TrieRangeQuery/-Filter only work correctly for optimized indexes (as the count is reset on each query execution. So the new multisegment-search must have a one-segment index to only execute the query one time)
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@737079 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d545a46df5
commit
7ef048e01c
|
@ -102,6 +102,7 @@ public final class TrieRangeQuery extends ConstantScoreQuery {
|
||||||
/**
|
/**
|
||||||
* EXPERT: Return the number of terms visited during the last execution of the query.
|
* EXPERT: Return the number of terms visited during the last execution of the query.
|
||||||
* This may be used for performance comparisons of different trie variants and their effectiveness.
|
* This may be used for performance comparisons of different trie variants and their effectiveness.
|
||||||
|
* When using this method be sure to query an one-segment index (optimized one) to get correct results.
|
||||||
* This method is not thread safe, be sure to only call it when no query is running!
|
* This method is not thread safe, be sure to only call it when no query is running!
|
||||||
* @throws IllegalStateException if query was not yet executed.
|
* @throws IllegalStateException if query was not yet executed.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class TestTrieRangeQuery extends LuceneTestCase
|
||||||
writer.addDocument(doc);
|
writer.addDocument(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
writer.optimize();
|
||||||
writer.close();
|
writer.close();
|
||||||
searcher=new IndexSearcher(directory);
|
searcher=new IndexSearcher(directory);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue