Add operators for absolute last-updated-on search

Some users may have been using sortkey to exclude changes older than
a certain date. This is possible but inconvenient to mimic with an
age: query, so provide operators for absolute searches.

The semantics of these operators are similar to those of `git log`,
except for some incompatibilities/quirks of JGit's GitDateParser.

Change-Id: I52fee758052a5644beb3c97bf727f92129245f3f
This commit is contained in:
Dave Borowitz
2014-02-11 16:43:36 -08:00
parent 0f3fa96e7e
commit a0af7febe6
8 changed files with 258 additions and 18 deletions

View File

@@ -45,7 +45,7 @@ import org.apache.lucene.search.TermQuery;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.NumericUtils;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
public class QueryBuilder {
@@ -232,7 +232,7 @@ public class QueryBuilder {
return queryBuilder.createPhraseQuery(p.getField().getName(), p.getValue());
}
public static int toIndexTime(Timestamp ts) {
public static int toIndexTime(Date ts) {
return (int) (ts.getTime() / 60000);
}