if (luceneQuery instanceof TermQuery) {
Term t = ((TermQuery) luceneQuery).getTerm();
if (t.field().equals(freeTextBlock)) {
// nothing for now
} else {
casQuery.addCriterion(new TermQueryCriteria(t.field(),
t.text()));
}
} else if (luceneQuery instanceof PhraseQuery) {
Term[] t = ((PhraseQuery) luceneQuery).getTerms();
if (t[0].field().equals(freeTextBlock)) {
// nothing for now
} else {
for (int i = 0; i < t.length; i++)
casQuery.addCriterion(new TermQueryCriteria(
t[i].field(), t[i].text()));
}
} else if (luceneQuery instanceof RangeQuery) {
Term startT = ((RangeQuery) luceneQuery).getLowerTerm();
Term endT = ((RangeQuery) luceneQuery).getUpperTerm();