public virtual void TestInclusiveLowerNull()
{
//http://issues.apache.org/jira/browse/LUCENE-38
Analyzer analyzer = new SingleCharAnalyzer();
Query query = new TermRangeQuery("content", null, "C", true, true);
InitializeIndex(new System.String[]{"A", "B", "", "C", "D"}, analyzer);
IndexSearcher searcher = new IndexSearcher(dir, true);
int numHits = searcher.Search(query, null, 1000).TotalHits;
// When Lucene-38 is fixed, use the assert on the next line:
Assert.AreEqual(4, numHits, "A,B,<empty string>,C,D => A,B,<empty string>,C in range");
// until Lucene-38 is fixed, use this assert
//Assert.AreEqual(3, hits.length(), "A,B,<empty string>,C,D => A,B,<empty string>,C in range");
searcher.Close();
InitializeIndex(new System.String[]{"A", "B", "", "D"}, analyzer);
searcher = new IndexSearcher(dir, true);
numHits = searcher.Search(query, null, 1000).TotalHits;
// When Lucene-38 is fixed, use the assert on the next line:
Assert.AreEqual(3, numHits, "A,B,<empty string>,D - A, B and <empty string> in range");
// until Lucene-38 is fixed, use this assert
//Assert.AreEqual(2, hits.length(), "A,B,<empty string>,D => A, B and <empty string> in range");
searcher.Close();
AddDoc("C");
searcher = new IndexSearcher(dir, true);
numHits = searcher.Search(query, null, 1000).TotalHits;
// When Lucene-38 is fixed, use the assert on the next line:
Assert.AreEqual(4, numHits, "C added => A,B,<empty string>,C in range");
// until Lucene-38 is fixed, use this assert
//Assert.AreEqual(3, hits.length(), "C added => A,B,<empty string>,C in range");
searcher.Close();
}
}