Package org.apache.lucene.tests.index
Class RandomPostingsTester
java.lang.Object
org.apache.lucene.tests.index.RandomPostingsTester
Helper class extracted from BasePostingsFormatTestCase to exercise a postings format.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHolds one field, term and ord.static enumWhich features to test.static classGiven the same random seed this always enumerates the same random postings -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildIndex(Codec codec, Directory dir, IndexOptions maxAllowed, boolean allowPayloads, boolean alwaysTestMax) getSeedPostings(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 Details
-
RandomPostingsTester
- Throws:
IOException
-
-
Method Details
-
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
-
testFields
- 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
-