public class LuceneQuery extends java.lang.Object implements ParametersCallback, java.io.Closeable
Constructor and Description |
---|
LuceneQuery(java.lang.String indexPath,
ParametersCallback parametersCallback,
QueryCallback queryCallback)
Creates a query for Lucene index.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
execute(java.io.Reader queryReader,
java.util.Collection<java.lang.String> fields,
java.lang.Boolean useMultiFieldParser,
java.lang.Boolean useLowercaseExpandedTerms)
Executes a query.
|
java.lang.Object |
getParameter(java.lang.String name)
Returns the value of parameter specified by name.
|
public LuceneQuery(java.lang.String indexPath, ParametersCallback parametersCallback, QueryCallback queryCallback)
indexPath
- path to lucene indexparametersCallback
- parameters to use.queryCallback
- callback to use for result set iteration.public void execute(java.io.Reader queryReader, java.util.Collection<java.lang.String> fields, java.lang.Boolean useMultiFieldParser, java.lang.Boolean useLowercaseExpandedTerms)
queryReader
- query content reader. Closed after this method completes.fields
- fields to be searcheduseMultiFieldParser
- whether MultiFieldQueryParser
or QueryParser
to be useduseLowercaseExpandedTerms
- whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or notpublic java.lang.Object getParameter(java.lang.String name)
ParametersCallback
The callback internally delegates a call to parent callbacks if the parameter cannot be found.
getParameter
in interface ParametersCallback
name
- parameter name. Providers are allowed (but not required) to ignore a case of the name parameter
to comply with their internal model. For example JDBC drivers are case-insensitive to column names.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
Copyright © Copyright 2006-2019 The Scriptella Project Team.