You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by us...@apache.org on 2009/01/23 17:44:17 UTC
svn commit: r737079 - in /lucene/java/trunk/contrib/queries/src:
java/org/apache/lucene/search/trie/TrieRangeQuery.java
test/org/apache/lucene/search/trie/TestTrieRangeQuery.java
Author: uschindler
Date: Fri Jan 23 08:44:17 2009
New Revision: 737079
URL: http://svn.apache.org/viewvc?rev=737079&view=rev
Log:
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)
Modified:
lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/TrieRangeQuery.java
lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestTrieRangeQuery.java
Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/TrieRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/TrieRangeQuery.java?rev=737079&r1=737078&r2=737079&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/TrieRangeQuery.java (original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/TrieRangeQuery.java Fri Jan 23 08:44:17 2009
@@ -102,6 +102,7 @@
/**
* 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.
*/
Modified: lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestTrieRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestTrieRangeQuery.java?rev=737079&r1=737078&r2=737079&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestTrieRangeQuery.java (original)
+++ lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestTrieRangeQuery.java Fri Jan 23 08:44:17 2009
@@ -71,8 +71,9 @@
writer.addDocument(doc);
}
+ writer.optimize();
writer.close();
- searcher=new IndexSearcher(directory);
+ searcher=new IndexSearcher(directory);
} catch (Exception e) {
throw new Error(e);
}