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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user