}
private MultiTermQuery copyMultiTermQuery(MultiTermQuery query) {
if(query instanceof TermRangeQuery) {
TermRangeQuery q = (TermRangeQuery)query;
q.setBoost(query.getBoost());
return new TermRangeQuery(q.getField(), q.getLowerTerm(), q.getUpperTerm(), q.includesLower(), q.includesUpper());
} else if(query instanceof WildcardQuery) {
MultiTermQuery q = new WildcardQuery(query.getTerm());
q.setBoost(query.getBoost());
return q;
} else if(query instanceof PrefixQuery) {
MultiTermQuery q = new PrefixQuery(query.getTerm());
q.setBoost(q.getBoost());
return q;
} else if(query instanceof FuzzyQuery) {
FuzzyQuery q = (FuzzyQuery)query;
q.setBoost(q.getBoost());
return new FuzzyQuery(q.getTerm(), q.getMinSimilarity(), q.getPrefixLength());
}
return query;
}