Ensure tokens have at least 2 chars, otherwise norms are incorrect.

This commit is contained in:
Adrien Grand 2019-07-10 09:09:07 +02:00
parent 8322ea55f4
commit fb30ded643

View File

@ -45,7 +45,7 @@ public class TestCustomNorms extends LuceneTestCase {
Directory dir = newDirectory(); Directory dir = newDirectory();
MockAnalyzer analyzer = new MockAnalyzer(random()); MockAnalyzer analyzer = new MockAnalyzer(random());
analyzer.setMaxTokenLength(TestUtil.nextInt(random(), 1, IndexWriter.MAX_TERM_LENGTH)); analyzer.setMaxTokenLength(TestUtil.nextInt(random(), 2, IndexWriter.MAX_TERM_LENGTH));
IndexWriterConfig config = newIndexWriterConfig(analyzer); IndexWriterConfig config = newIndexWriterConfig(analyzer);
Similarity provider = new MySimProvider(); Similarity provider = new MySimProvider();