Lucene.Net.Index.BasePostingsFormatTestCase.TestFull C# (CSharp) Метод

TestFull() приватный Метод

Indexes all fields/terms at the specified IndexOptions, and fully tests at that IndexOptions.
private TestFull ( Lucene.Net.Index.FieldInfo options, bool withPayloads ) : void
options Lucene.Net.Index.FieldInfo
withPayloads bool
Результат void
        private void TestFull(FieldInfo.IndexOptions options, bool withPayloads)
        {
            DirectoryInfo path = CreateTempDir("testPostingsFormat.testExact");
            using (Directory dir = NewFSDirectory(path))
            {
                // TODO test thread safety of buildIndex too
                var fieldsProducer = BuildIndex(dir, options, withPayloads, true);

                TestFields(fieldsProducer);

                var allOptions = (FieldInfo.IndexOptions[]) Enum.GetValues(typeof (FieldInfo.IndexOptions));
                    //IndexOptions_e.values();
                int maxIndexOption = Arrays.AsList(allOptions).IndexOf(options);

                for (int i = 0; i <= maxIndexOption; i++)
                {
                    ISet<Option> allOptionsHashSet = new HashSet<Option>(Enum.GetValues(typeof (Option)).Cast<Option>());
                    TestTerms(fieldsProducer, allOptionsHashSet, allOptions[i], options, true);
                    if (withPayloads)
                    {
                        // If we indexed w/ payloads, also test enums w/o accessing payloads:
                        ISet<Option> payloadsHashSet = new HashSet<Option>() {Option.PAYLOADS};
                        var complementHashSet = new HashSet<Option>(allOptionsHashSet.Except(payloadsHashSet));
                        TestTerms(fieldsProducer, complementHashSet, allOptions[i], options, true);
                    }
                }

                fieldsProducer.Dispose();
            }
        }