public class LuceneUtils extends Object
Constructor and Description |
---|
LuceneUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
createDateRangeQuery(Date fromDate,
Date toDate,
org.alfresco.service.namespace.QName dateProperty,
org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService,
org.alfresco.service.namespace.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 boolean |
fieldHasTerm(org.apache.lucene.index.IndexReader indexReader,
String field) |
static String |
getLuceneDateString(Date date)
Returns a date string in the format required by Lucene.
|
public static boolean fieldHasTerm(org.apache.lucene.index.IndexReader indexReader, String field)
public static String getLuceneDateString(Date date)
public static String createDateRangeQuery(Date fromDate, Date toDate, org.alfresco.service.namespace.QName dateProperty, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, org.alfresco.service.namespace.NamespaceService namespaceService)
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).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 type DataTypeDefinition.DATE
or DataTypeDefinition.DATETIME
.Copyright © 2005–2017 Alfresco Software. All rights reserved.