Methods Summary |
---|
public void | bqtest(org.apache.lucene.search.Query q, int[] expDocNrs)Tests a query using qtest after wrapping it with both optB and reqB
qtest(reqB(q), expDocNrs);
qtest(optB(q), expDocNrs);
|
public void | bqtest(java.lang.String queryText, int[] expDocNrs)Tests a query using qtest after wrapping it with both optB and reqB
bqtest(makeQuery(queryText), expDocNrs);
|
public org.apache.lucene.search.Query | makeQuery(java.lang.String queryText)
return qp.parse(queryText);
|
public org.apache.lucene.search.Query | optB(java.lang.String q)MACRO: Wraps a Query in a BooleanQuery so that it is optional, along
with a second prohibited clause which will never match anything
return optB(makeQuery(q));
|
public org.apache.lucene.search.Query | optB(org.apache.lucene.search.Query q)MACRO: Wraps a Query in a BooleanQuery so that it is optional, along
with a second prohibited clause which will never match anything
BooleanQuery bq = new BooleanQuery(true);
bq.add(q, BooleanClause.Occur.SHOULD);
bq.add(new TermQuery(new Term("NEVER","MATCH")), BooleanClause.Occur.MUST_NOT);
return bq;
|
public void | qtest(java.lang.String queryText, int[] expDocNrs)check the expDocNrs first, then check the query (and the explanations)
qtest(makeQuery(queryText), expDocNrs);
|
public void | qtest(org.apache.lucene.search.Query q, int[] expDocNrs)check the expDocNrs first, then check the query (and the explanations)
CheckHits.checkHitCollector(q, FIELD, searcher, expDocNrs);
|
public org.apache.lucene.search.Query | reqB(java.lang.String q)MACRO: Wraps a Query in a BooleanQuery so that it is required, along
with a second optional clause which will match everything
return reqB(makeQuery(q));
|
public org.apache.lucene.search.Query | reqB(org.apache.lucene.search.Query q)MACRO: Wraps a Query in a BooleanQuery so that it is required, along
with a second optional clause which will match everything
BooleanQuery bq = new BooleanQuery(true);
bq.add(q, BooleanClause.Occur.MUST);
bq.add(new TermQuery(new Term(FIELD,"w1")), BooleanClause.Occur.SHOULD);
return bq;
|
public void | setUp()
RAMDirectory directory = new RAMDirectory();
IndexWriter writer= new IndexWriter(directory, new WhitespaceAnalyzer(), true);
for (int i = 0; i < docFields.length; i++) {
Document doc = new Document();
doc.add(new Field(FIELD, docFields[i], Field.Store.NO, Field.Index.TOKENIZED));
writer.addDocument(doc);
}
writer.close();
searcher = new IndexSearcher(directory);
|
public org.apache.lucene.search.spans.SpanFirstQuery | sf(java.lang.String s, int b)MACRO for SpanFirst(SpanTermQuery)
return new SpanFirstQuery(st(s), b);
|
public org.apache.lucene.search.spans.SpanNearQuery | snear(java.lang.String s, java.lang.String e, int slop, boolean inOrder)MACRO for SpanNearQuery containing two SpanTerm queries
return snear(st(s), st(e), slop, inOrder);
|
public org.apache.lucene.search.spans.SpanNearQuery | snear(org.apache.lucene.search.spans.SpanQuery s, org.apache.lucene.search.spans.SpanQuery e, int slop, boolean inOrder)MACRO for SpanNearQuery containing two SpanQueries
return new SpanNearQuery(new SpanQuery[] { s, e }, slop, inOrder);
|
public org.apache.lucene.search.spans.SpanNearQuery | snear(java.lang.String s, java.lang.String m, java.lang.String e, int slop, boolean inOrder)MACRO for SpanNearQuery containing three SpanTerm queries
return snear(st(s), st(m), st(e), slop, inOrder);
|
public org.apache.lucene.search.spans.SpanNearQuery | snear(org.apache.lucene.search.spans.SpanQuery s, org.apache.lucene.search.spans.SpanQuery m, org.apache.lucene.search.spans.SpanQuery e, int slop, boolean inOrder)MACRO for SpanNearQuery containing three SpanQueries
return new SpanNearQuery(new SpanQuery[] { s, m, e }, slop, inOrder);
|
public org.apache.lucene.search.spans.SpanNotQuery | snot(org.apache.lucene.search.spans.SpanQuery i, org.apache.lucene.search.spans.SpanQuery e)MACRO for SpanNotQuery
return new SpanNotQuery(i,e);
|
public org.apache.lucene.search.spans.SpanOrQuery | sor(java.lang.String s, java.lang.String e)MACRO for SpanOrQuery containing two SpanTerm queries
return sor(st(s), st(e));
|
public org.apache.lucene.search.spans.SpanOrQuery | sor(org.apache.lucene.search.spans.SpanQuery s, org.apache.lucene.search.spans.SpanQuery e)MACRO for SpanOrQuery containing two SpanQueries
return new SpanOrQuery(new SpanQuery[] { s, e });
|
public org.apache.lucene.search.spans.SpanOrQuery | sor(java.lang.String s, java.lang.String m, java.lang.String e)MACRO for SpanOrQuery containing three SpanTerm queries
return sor(st(s), st(m), st(e));
|
public org.apache.lucene.search.spans.SpanOrQuery | sor(org.apache.lucene.search.spans.SpanQuery s, org.apache.lucene.search.spans.SpanQuery m, org.apache.lucene.search.spans.SpanQuery e)MACRO for SpanOrQuery containing two SpanQueries
return new SpanOrQuery(new SpanQuery[] { s, m, e });
|
public org.apache.lucene.search.spans.SpanTermQuery | st(java.lang.String s)MACRO for SpanTermQuery
return new SpanTermQuery(new Term(FIELD,s));
|
public static org.apache.lucene.index.Term[] | ta(java.lang.String[] s)helper for generating MultiPhraseQueries
Term[] t = new Term[s.length];
for (int i = 0; i < s.length; i++) {
t[i] = new Term(FIELD, s[i]);
}
return t;
|
public void | tearDown()
searcher.close();
|
public void | testNoop()Placeholder: JUnit freaks if you don't have one test ... making
class abstract doesn't help
/* NOOP */
|