BooleanQueryTstpublic class BooleanQueryTst extends Object
Fields Summary |
---|
String | queryText | final int[] | expectedDocNrs | SingleFieldTestDb | dBase | String | fieldName | TestCase | testCase | BasicQueryFactory | qf | boolean | verbose |
Constructors Summary |
---|
public BooleanQueryTst(String queryText, int[] expectedDocNrs, SingleFieldTestDb dBase, String fieldName, TestCase testCase, BasicQueryFactory qf)
this.queryText = queryText;
this.expectedDocNrs = expectedDocNrs;
this.dBase = dBase;
this.fieldName = fieldName;
this.testCase = testCase;
this.qf = qf;
|
Methods Summary |
---|
public void | doTest()
if (verbose) {
System.out.println("");
System.out.println("Query: " + queryText);
}
SrndQuery lq = QueryParser.parse(queryText);
/* if (verbose) System.out.println("Srnd: " + lq.toString()); */
Query query = lq.makeLuceneQueryField(fieldName, qf);
/* if (verbose) System.out.println("Lucene: " + query.toString()); */
TestCollector tc = new TestCollector();
Searcher searcher = new IndexSearcher(dBase.getDb());
try {
searcher.search(query, tc);
} finally {
searcher.close();
}
tc.checkNrHits();
| public void | setVerbose(boolean verbose)this.verbose = verbose;
|
|