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
Modifier and TypeClassDescriptionstatic class
Holds one field, term and ord.static enum
Which features to test.static class
Given the same random seed this always enumerates the same random postings -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildIndex
(Codec codec, Directory dir, IndexOptions maxAllowed, boolean allowPayloads, boolean alwaysTestMax) getSeedPostings
(String term, long seed, IndexOptions options, boolean allowPayloads) void
testFields
(Fields fields) void
testFull
(Codec codec, Path path, IndexOptions options, boolean withPayloads) Indexes all fields/terms at the specified IndexOptions, and fully tests at that IndexOptions.void
testTerms
(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
-