private static Query[] getPrebuiltQueries(String field) {
WildcardQuery wcq = new WildcardQuery(new Term(field, "fo*"));
wcq .setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE);
// be wary of unanalyzed text
return new Query[] {
new SpanFirstQuery(new SpanTermQuery(new Term(field, "ford")), 5),
new SpanNearQuery(new SpanQuery[] {
new SpanTermQuery(new Term(field, "night")),
new SpanTermQuery(new Term(field, "trading")) }, 4, false),
new SpanNearQuery(new SpanQuery[] {
new SpanFirstQuery(new SpanTermQuery(new Term(field, "ford")), 10),
new SpanTermQuery(new Term(field, "credit")) }, 10, false), wcq, };
}