public class LuceneUtils
extends java.lang.Object
Constructor and Description |
---|
LuceneUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
createDateRangeQuery(java.util.Date fromDate,
java.util.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 boolean |
fieldHasTerm(org.apache.lucene.index.IndexReader indexReader,
java.lang.String field) |
static java.lang.String |
getLuceneDateString(java.util.Date date)
Returns a date string in the format required by Lucene.
|
public static boolean fieldHasTerm(org.apache.lucene.index.IndexReader indexReader, java.lang.String field)
public static java.lang.String getLuceneDateString(java.util.Date date)
public static java.lang.String createDateRangeQuery(java.util.Date fromDate, java.util.Date toDate, QName dateProperty, DictionaryService dictionaryService, 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).java.lang.NullPointerException
- if dateProperty is null or if the dateProperty is not recognised by the system.java.lang.IllegalArgumentException
- if dateProperty refers to a property that is not of type DataTypeDefinition.DATE
or DataTypeDefinition.DATETIME
.Copyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.