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:
Uwe Schindler 2009-01-23 16:44:17 +00:00
parent d545a46df5
commit 7ef048e01c
2 changed files with 3 additions and 1 deletions

View File

@ -102,6 +102,7 @@ public final class TrieRangeQuery extends ConstantScoreQuery {
/**
* 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.
* 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!
* @throws IllegalStateException if query was not yet executed.
*/

View File

@ -71,6 +71,7 @@ public class TestTrieRangeQuery extends LuceneTestCase
writer.addDocument(doc);
}
writer.optimize();
writer.close();
searcher=new IndexSearcher(directory);
} catch (Exception e) {