mirror of https://github.com/apache/lucene.git
fix testcase to only run QueryUtils on a optimized index
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1421793 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dbd3ce549f
commit
48b1d3a2aa
|
@ -257,8 +257,6 @@ public class CommonTermsQuery extends Query {
|
|||
* Returns true iff {@link Similarity#coord(int,int)} is disabled in scoring
|
||||
* for the high and low frequency query instance. The top level query will
|
||||
* always disable coords.
|
||||
*
|
||||
* @see #CommonTermsQuery(Occur, Occur, float, boolean)
|
||||
*/
|
||||
public boolean isCoordDisabled() {
|
||||
return disableCoord;
|
||||
|
|
|
@ -263,7 +263,6 @@ public class CommonTermsQueryTest extends LuceneTestCase {
|
|||
}
|
||||
|
||||
TopDocs cqSearch = searcher.search(cq, reader.maxDoc());
|
||||
QueryUtils.check(random(), cq, searcher);
|
||||
|
||||
TopDocs verifySearch = searcher.search(verifyQuery, reader.maxDoc());
|
||||
assertEquals(verifySearch.totalHits, cqSearch.totalHits);
|
||||
|
@ -277,6 +276,17 @@ public class CommonTermsQueryTest extends LuceneTestCase {
|
|||
}
|
||||
|
||||
assertTrue(hits.isEmpty());
|
||||
|
||||
/*
|
||||
* need to force merge here since QueryUtils adds checks based
|
||||
* on leave readers which have different statistics than the top
|
||||
* level reader if we have more than one segment. This could
|
||||
* result in a different query / results.
|
||||
*/
|
||||
w.forceMerge(1);
|
||||
DirectoryReader reader2 = w.getReader();
|
||||
QueryUtils.check(random(), cq, newSearcher(reader2));
|
||||
reader2.close();
|
||||
} finally {
|
||||
reader.close();
|
||||
wrapper.close();
|
||||
|
|
Loading…
Reference in New Issue