Skip to content
Permalink
Browse files

fix test bug (boosting stopwords with DFI)

  • Loading branch information...
rmuir committed Jan 27, 2016
1 parent f3ca357 commit 283d9bb4b7aaaae02ebd285566bdc59dd3950cac
Showing with 4 additions and 0 deletions.
  1. +4 −0 lucene/queries/src/test/org/apache/lucene/queries/CommonTermsQueryTest.java
@@ -48,6 +48,7 @@
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.similarities.BM25Similarity;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;
@@ -361,6 +362,9 @@ public void testExtend() throws IOException {

IndexReader r = w.getReader();
IndexSearcher s = newSearcher(r);
// don't use a randomized similarity, e.g. stopwords for DFI can get scored as 0,
// so boosting them is kind of crazy
s.setSimilarity(new BM25Similarity());
{
CommonTermsQuery query = new CommonTermsQuery(Occur.SHOULD, Occur.SHOULD,
random().nextBoolean() ? 2.0f : 0.5f);

0 comments on commit 283d9bb

Please sign in to comment.
You can’t perform that action at this time.