Lucene.Net.Search.TestFilteredQuery.TBooleanSHOULD C# (CSharp) Méthode

TBooleanSHOULD() private méthode

private TBooleanSHOULD ( bool useRandomAccess ) : void
useRandomAccess bool
Résultat void
        private void TBooleanSHOULD(bool useRandomAccess)
        {
            BooleanQuery bq = new BooleanQuery();
            Query query = new FilteredQuery(new TermQuery(new Term("field", "one")), new SingleDocTestFilter(0), RandomFilterStrategy(Random(), useRandomAccess));
            bq.Add(query, BooleanClause.Occur.SHOULD);
            query = new FilteredQuery(new TermQuery(new Term("field", "one")), new SingleDocTestFilter(1), RandomFilterStrategy(Random(), useRandomAccess));
            bq.Add(query, BooleanClause.Occur.SHOULD);
            ScoreDoc[] hits = Searcher.Search(bq, null, 1000).ScoreDocs;
            Assert.AreEqual(2, hits.Length);
            QueryUtils.Check(Random(), query, Searcher, Similarity);
        }