String[] opt = CommonGrams.optimizePhrase(c.getPhrase(), field);
if (opt.length==1) {
c = new Clause(new Query.Term(opt[0]),
c.isRequired(), c.isProhibited());
} else {
c = new Clause(new Phrase(opt), c.isRequired(), c.isProhibited());
}
}
// construct appropriate Lucene clause
org.apache.lucene.search.Query luceneClause;
if (c.isPhrase()) {
Phrase nutchPhrase = c.getPhrase();
Query.Term[] terms = nutchPhrase.getTerms();
PhraseQuery lucenePhrase = new PhraseQuery();
for (int j = 0; j < terms.length; j++) {
lucenePhrase.add(new Term(field, terms[j].toString()));
}
luceneClause = lucenePhrase;