Lucene.Net.Search.TestBooleanQuery.TestInOrderWithMinShouldMatch C# (CSharp) Method

TestInOrderWithMinShouldMatch() private method

private TestInOrderWithMinShouldMatch ( ) : void
return void
        public virtual void TestInOrderWithMinShouldMatch()
        {
            Directory dir = NewDirectory();
            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
            Document doc = new Document();
            doc.Add(NewTextField("field", "some text here", Field.Store.NO));
            w.AddDocument(doc);
            IndexReader r = w.Reader;
            w.Dispose();
            IndexSearcher s = new IndexSearcherAnonymousInnerClassHelper(this, r);
            BooleanQuery bq = new BooleanQuery();
            bq.Add(new TermQuery(new Term("field", "some")), BooleanClause.Occur.SHOULD);
            bq.Add(new TermQuery(new Term("field", "text")), BooleanClause.Occur.SHOULD);
            bq.Add(new TermQuery(new Term("field", "here")), BooleanClause.Occur.SHOULD);
            bq.MinimumNumberShouldMatch = 2;
            s.Search(bq, 10);
            r.Dispose();
            dir.Dispose();
        }