Package org.apache.lucene.tests.index
Class RandomPostingsTester
- java.lang.Object
-
- org.apache.lucene.tests.index.RandomPostingsTester
-
public class RandomPostingsTester extends Object
Helper class extracted from BasePostingsFormatTestCase to exercise a postings format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRandomPostingsTester.FieldAndTermHolds one field, term and ord.static classRandomPostingsTester.OptionWhich features to test.static classRandomPostingsTester.SeedPostingsGiven the same random seed this always enumerates the same random postings
-
Constructor Summary
Constructors Constructor Description RandomPostingsTester(Random random)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldsProducerbuildIndex(Codec codec, Directory dir, IndexOptions maxAllowed, boolean allowPayloads, boolean alwaysTestMax)static RandomPostingsTester.SeedPostingsgetSeedPostings(String term, long seed, IndexOptions options, boolean allowPayloads)voidtestFields(Fields fields)voidtestFull(Codec codec, Path path, IndexOptions options, boolean withPayloads)Indexes all fields/terms at the specified IndexOptions, and fully tests at that IndexOptions.voidtestTerms(Fields fieldsSource, EnumSet<RandomPostingsTester.Option> options, IndexOptions maxTestOptions, IndexOptions maxIndexOptions, boolean alwaysTestMax)
-
-
-
Constructor Detail
-
RandomPostingsTester
public RandomPostingsTester(Random random) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getSeedPostings
public static RandomPostingsTester.SeedPostings getSeedPostings(String term, long seed, IndexOptions options, boolean allowPayloads)
-
buildIndex
public FieldsProducer buildIndex(Codec codec, Directory dir, IndexOptions maxAllowed, boolean allowPayloads, boolean alwaysTestMax) throws IOException
- Throws:
IOException
-
testTerms
public void testTerms(Fields fieldsSource, EnumSet<RandomPostingsTester.Option> options, IndexOptions maxTestOptions, IndexOptions maxIndexOptions, boolean alwaysTestMax) throws Exception
- Throws:
Exception
-
testFull
public void testFull(Codec codec, Path path, IndexOptions options, boolean withPayloads) throws Exception
Indexes all fields/terms at the specified IndexOptions, and fully tests at that IndexOptions.- Throws:
Exception
-
-