Package org.alfresco.repo.search
Class LuceneUtils
java.lang.Object
org.alfresco.repo.search.LuceneUtils
Lucene utils
- Author:
- Andy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateDateRangeQuery(Date fromDate, Date toDate, QName dateProperty, DictionaryService dictionaryService, NamespaceService namespaceService) This method creates a Lucene query fragment which constrains the specified dateProperty to a range given by the fromDate and toDate parameters.static StringgetLuceneDateString(Date date) Returns a date string in the format required by Lucene.
-
Constructor Details
-
LuceneUtils
public LuceneUtils()
-
-
Method Details
-
getLuceneDateString
Returns a date string in the format required by Lucene.- Since:
- 4.0
-
createDateRangeQuery
public static String createDateRangeQuery(Date fromDate, Date toDate, QName dateProperty, DictionaryService dictionaryService, NamespaceService namespaceService) This method creates a Lucene query fragment which constrains the specified dateProperty to a range given by the fromDate and toDate parameters.- Parameters:
fromDate- the start of the date range (defaults to 1970-01-01 00:00:00 if null).toDate- the end of the date range (defaults to 3000-12-31 00:00:00 if null).dateProperty- the Alfresco property value to check against the range (must be a valid Date or DateTime property).- Returns:
- the Lucene query fragment.
- Throws:
NullPointerException- if dateProperty is null or if the dateProperty is not recognised by the system.IllegalArgumentException- if dateProperty refers to a property that is not of typeDataTypeDefinition.DATEorDataTypeDefinition.DATETIME.
-