org.openanzo.indexer.lucene
Class LuceneQuery

java.lang.Object
  extended by org.openanzo.indexer.lucene.LuceneQuery
All Implemented Interfaces:
IQuery
Direct Known Subclasses:
ModelIndexQuery

public class LuceneQuery
extends java.lang.Object
implements IQuery

Implementation of IQuery based on Lucene.

Author:
Wing Yung ( wingyung@us.ibm.com )

Constructor Summary
LuceneQuery()
           
 
Method Summary
 org.apache.lucene.search.Filter getFilter()
          Get the underlying Filter object.
 org.apache.lucene.search.Query getQuery()
          Get the underlying Query object
 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 text)
          Initializes a simple query.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneQuery

public LuceneQuery()
Method Detail

initialize

public void initialize(java.util.Properties properties)
                throws IndexerException
Initializes the query with the properties object. The properties object is expected to contain the default field to search (org.openanzo.indexer.lucene.query.field) and the text to search for (org.openanzo.indexer.lucene.query.text).

Specified by:
initialize in interface IQuery
Parameters:
properties - configuration for this query
Throws:
IndexerException

initialize

public void initialize(java.lang.String queryStr)
                throws IndexerException
Initializes the query based on the queryStr

Specified by:
initialize in interface IQuery
Parameters:
queryStr - query string, can use Lucene Query constructs
Throws:
IndexerException

initialize

public void initialize(java.lang.String defaultField,
                       java.lang.String text)
                throws IndexerException
Initializes a simple query. Sets the default field to search, along with the text to search. Note that text may contain other modifiers so that other fields are searched as well.

Specified by:
initialize in interface IQuery
Parameters:
defaultField - default field to search in this query
text - text query to search for, can use Lucene Query constructs
Throws:
IndexerException

getQuery

public org.apache.lucene.search.Query getQuery()
Get the underlying Query object

Returns:
the underlying Query object

getFilter

public org.apache.lucene.search.Filter getFilter()
Get the underlying Filter object.

Returns:
the underlying Filter object.


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.