|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.indexer.lucene.LuceneQuery
org.openanzo.model.indexer.lucene.ModelIndexQuery
public class ModelIndexQuery
Adds a date filter to the query. This stuff should be in another class since it's not indexer-specific. A date range should be specified as part of the query string. It will have the following format: http://openanzo.orgified:date_expression The date expression defines a date range determined by two time expressions. Time expressions can assume one of four forms: 1) a string containing the number of ms that have elapsed since January 1, 1970, 2) * for before/after expressions (see below), 3) a relative time expression, or 4) an absolute time expression. Relative time expressions begin with y (year), mo (month), d (date), * h (hour) or mi (minute). The next character in a relative time expression is '-' (can be interpreted as minus). mo-2 means two months ago, h-4 means four hours ago, etc. Absolute time expressions also begin with y, mo, d, h, or mi. The numbers following specify the exact time, with 4 chars for the year and two for each subsequent time unit. mo200404 means April 2004, mi200505051921 means 7:21pm on May 5, 2005. An absolute time may be passed in alone as a time range. The implied time range goes from the specified time to one time unit beyond the specified time. so modified:mo200506 encapsulates all of June 2005, modified:d20050621 encapsulates all of June 21, 2005. Ranges are of the form start_char time_expr_1 to time_expr_2 end_char. start_char is '[' or '{'. end_char is ']' or '}'. [ and ] include the dates that they are adjacent to, and { and } exclude the dates that they are adjacent to. Note that in the case where both time expressions are relative time expressions, the start_char and end_char must be present but they will be ignored. For relative time expressions, the implied inclusion/exclusion is as follows: [time_expr_1 to time_expr_2}
| Constructor Summary | |
|---|---|
ModelIndexQuery()
Create a new ModelIndexQuery |
|
| Method Summary | |
|---|---|
void |
initialize(java.util.Properties properties)
Initializes the query with the properties object. |
void |
initialize(java.lang.String queryStr)
Initializes the query based on the queryStr |
void |
initialize(java.lang.String defaultField,
java.lang.String queryStr)
Initializes a simple query. |
static void |
main(java.lang.String[] args)
Tests date parsing |
| Methods inherited from class org.openanzo.indexer.lucene.LuceneQuery |
|---|
getFilter, getQuery |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ModelIndexQuery()
| Method Detail |
|---|
public void initialize(java.util.Properties properties)
throws IndexerException
LuceneQuery
initialize in interface IQueryinitialize in class LuceneQueryproperties - configuration for this query
IndexerException
public void initialize(java.lang.String defaultField,
java.lang.String queryStr)
throws IndexerException
LuceneQuery
initialize in interface IQueryinitialize in class LuceneQuerydefaultField - default field to search in this queryqueryStr - text query to search for, can use Lucene Query constructs
IndexerException
public void initialize(java.lang.String queryStr)
throws IndexerException
LuceneQuery
initialize in interface IQueryinitialize in class LuceneQueryqueryStr - query string, can use Lucene Query constructs
IndexerException
public static void main(java.lang.String[] args)
throws IndexerException
args -
IndexerException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||