Class SearchUtils
- java.lang.Object
-
- com.couchbase.client.java.search.util.SearchUtils
-
@Uncommitted @Public public class SearchUtils extends Object
Utility class around FTS (Full Text Search), and especially handling of the default FTS date format (which corresponds to RFC 3339).- Since:
- 2.3.0
- Author:
- Simon Baslé, Michael Nitschinger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DatefromFtsString(String date)Attempts to convert a date string, as returned by the FTS service, into aDate.static StringtoFtsUtcString(Date date)Converts a date to the default string representation in FTS (RFC 3339).
-
-
-
Method Detail
-
toFtsUtcString
public static String toFtsUtcString(Date date)
Converts a date to the default string representation in FTS (RFC 3339).- Parameters:
date- theDateto convert.- Returns:
- the RFC 3339 representation of the date, in UTC timezone (eg. "2016-01-19T14:44:01Z")
-
fromFtsString
public static Date fromFtsString(String date)
Attempts to convert a date string, as returned by the FTS service, into aDate. The FTS service is expected to return date strings in RFC 3339 format, including the timezone information. For example:2016-01-10T14:44:01-08:00for a date in the UTC-8/PDT timezone.- Parameters:
date- the date in RFC 3339 format.- Returns:
- the corresponding
Date. - Throws:
CouchbaseException- when the date could not be parsed.
-
-