From 76fab9d42af91f5ddf3b7c06fcd6a374b29cad0d Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Mon, 16 Jun 2014 10:50:17 +0200 Subject: [PATCH] [TEST] consistently omit norms in test otherwise scoring will be dependent on merges etc. --- .../java/org/apache/lucene/queries/BlendedTermQueryTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java b/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java index bec41d70fe5..5e1ba0bd8c9 100644 --- a/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java +++ b/src/test/java/org/apache/lucene/queries/BlendedTermQueryTest.java @@ -108,14 +108,15 @@ public class BlendedTermQueryTest extends ElasticsearchLuceneTestCase { String[] song = new String[]{ "generator", "foo fighers - generator", "foo fighters generator" }; + final boolean omitNorms = random().nextBoolean(); FieldType ft = new FieldType(TextField.TYPE_NOT_STORED); ft.setIndexOptions(random().nextBoolean() ? FieldInfo.IndexOptions.DOCS_ONLY : FieldInfo.IndexOptions.DOCS_AND_FREQS); - ft.setOmitNorms(random().nextBoolean()); + ft.setOmitNorms(omitNorms); ft.freeze(); FieldType ft1 = new FieldType(TextField.TYPE_NOT_STORED); ft1.setIndexOptions(random().nextBoolean() ? FieldInfo.IndexOptions.DOCS_ONLY : FieldInfo.IndexOptions.DOCS_AND_FREQS); - ft1.setOmitNorms(random().nextBoolean()); + ft1.setOmitNorms(omitNorms); ft1.freeze(); for (int i = 0; i < username.length; i++) { Document d = new Document();