public class LuceneUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
dateToString(Date date)
Turns a given date-time (point in time) value into a String suitable for storing and searching in Lucene.
|
static String |
localDateToString(LocalDate localDate)
Turns a given
LocalDate value into a String suitable for storing and searching in Lucene. |
static Date |
stringToDate(String s) |
static LocalDate |
stringToLocalDate(String indexValue) |
public static String localDateToString(LocalDate localDate)
LocalDate
value into a String suitable for storing and searching in Lucene.
The date is stored as "YYYYMMDD". If the date is null we store "99999999" which causes nulls to sort to the end. (This is traditional JIRA behaviour)
localDate
- the date to be converted. May be nullpublic static String dateToString(Date date)
The date-time is stored as the number of seconds. If the date is null we store the encoded form of Long.MAX_VALUE which causes nulls to sort to the end. (This is traditional JIRA behaviour)
date
- the date to be converted. May be nullCopyright © 2002-2017 Atlassian. All Rights Reserved.