Lucene.Net.Search.TestWildcard.TestQuestionmark C# (CSharp) Method

TestQuestionmark() private method

private TestQuestionmark ( ) : void
return void
        public virtual void TestQuestionmark()
        {
            Directory indexStore = GetIndexStore("body", new string[] { "metal", "metals", "mXtals", "mXtXls" });
            IndexReader reader = DirectoryReader.Open(indexStore);
            IndexSearcher searcher = NewSearcher(reader);
            Query query1 = new WildcardQuery(new Term("body", "m?tal"));
            Query query2 = new WildcardQuery(new Term("body", "metal?"));
            Query query3 = new WildcardQuery(new Term("body", "metals?"));
            Query query4 = new WildcardQuery(new Term("body", "m?t?ls"));
            Query query5 = new WildcardQuery(new Term("body", "M?t?ls"));
            Query query6 = new WildcardQuery(new Term("body", "meta??"));

            AssertMatches(searcher, query1, 1);
            AssertMatches(searcher, query2, 1);
            AssertMatches(searcher, query3, 0);
            AssertMatches(searcher, query4, 3);
            AssertMatches(searcher, query5, 0);
            AssertMatches(searcher, query6, 1); // Query: 'meta??' matches 'metals' not 'metal'
            reader.Dispose();
            indexStore.Dispose();
        }