public virtual void TestStopwords()
{
QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "a",
new StopAnalyzer(Version.LUCENE_CURRENT,
StopFilter.MakeStopSet(new[] {"the", "foo"})));
Query result = qp.Parse("a:the OR a:foo");
Assert.IsNotNull(result, "result is null and it shouldn't be");
Assert.IsTrue(result is BooleanQuery, "result is not a BooleanQuery");
Assert.IsTrue(((BooleanQuery) result).Clauses.Count == 0, ((BooleanQuery) result).Clauses.Count + " does not equal: " + 0);
result = qp.Parse("a:woo OR a:the");
Assert.IsNotNull(result, "result is null and it shouldn't be");
Assert.IsTrue(result is TermQuery, "result is not a TermQuery");
result = qp.Parse("(fieldX:xxxxx OR fieldy:xxxxxxxx)^2 AND (fieldx:the OR fieldy:foo)");
Assert.IsNotNull(result, "result is null and it shouldn't be");
Assert.IsTrue(result is BooleanQuery, "result is not a BooleanQuery");
System.Console.Out.WriteLine("Result: " + result);
Assert.IsTrue(((BooleanQuery) result).Clauses.Count == 2, ((BooleanQuery) result).Clauses.Count + " does not equal: " + 2);
}