* @param crit
* @return query
* @throws UnsupportedSearchException
*/
public static Query createInternalDateQuery(SearchQuery.InternalDateCriterion crit) throws UnsupportedSearchException {
DateOperator op = crit.getOperator();
DateResolution res = op.getDateResultion();
Date date = op.getDate();
long value = DateUtils.truncate(date, SearchQuery.toCalendarType(res)).getTime();
String field = toInteralDateField(res);
switch(op.getType()) {
case ON:
return NumericRangeQuery.newLongRange(field ,value, value, true, true);
case BEFORE:
return NumericRangeQuery.newLongRange(field ,0L, value, true, false);
case AFTER: