if (this.startFieldEndValue != null) {
startFieldEndTerm = new Term(this.startFieldName,
this.startFieldEndValue);
}
RangeQuery query1 = new RangeQuery(startFieldStartTerm,
startFieldEndTerm, true);
booleanQuery.add(query1, BooleanClause.Occur.MUST);
if (this.endFieldName != null
&& (this.endFieldStartValue != null || this.endFieldEndValue != null)) {
Term endFieldEndTerm = null, endFieldStartTerm = null;
if (this.endFieldStartValue != null) {
endFieldStartTerm = new Term(this.endFieldName,
this.endFieldStartValue);
}
if (this.endFieldEndValue != null) {
endFieldEndTerm = new Term(this.endFieldName,
this.endFieldEndValue);
}
RangeQuery query2 = new RangeQuery(endFieldStartTerm,
endFieldEndTerm, true);
booleanQuery.add(query2, BooleanClause.Occur.MUST);
}
Sort sort = new Sort(new SortField("CAS.ProductReceivedTime",