|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlux.Evaluator
public class Evaluator
This class holds all the per-request state required for evaluating queries. It is *not* thread-safe.
| Nested Class Summary | |
|---|---|
class |
Evaluator.LuxCollectionURIResolver
|
class |
Evaluator.LuxURIResolver
|
| Field Summary | |
|---|---|
static String |
LUX_NAMESPACE
|
| Constructor Summary | |
|---|---|
Evaluator()
Creates a query evaluator that has no association with an index (no searcher or writer). |
|
Evaluator(Compiler compiler,
LuxSearcher searcher,
DocWriter docWriter)
Creates an evaluator that uses the provided objects to evaluate queries. |
|
| Method Summary | |
|---|---|
net.sf.saxon.s9api.XdmNode |
build(Reader xml,
String uri)
Build a document as a Saxon XdmNode. |
void |
close()
Call this method to release the Evaluator from its role as the URI and Collection URI Resolver, and to close the underlying Lucene Searcher. |
static Evaluator |
createEvaluator(org.apache.lucene.store.Directory dir)
Creates a query evaluator that searches and writes to the given Directory (Lucene index). |
XdmResultSet |
evaluate(String query)
Compile and evaluate the given query, as XQuery, with no context defined. |
XdmResultSet |
evaluate(String query,
QueryContext context)
|
XdmResultSet |
evaluate(net.sf.saxon.s9api.XQueryExecutable xquery)
Evaluate the already-compiled query, with no context defined. |
XdmResultSet |
evaluate(net.sf.saxon.s9api.XQueryExecutable xquery,
QueryContext context)
|
Compiler |
getCompiler()
|
CachingDocReader |
getDocReader()
|
DocWriter |
getDocWriter()
|
TransformErrorListener |
getErrorListener()
|
LuxQueryParser |
getLuxQueryParser()
|
QueryStats |
getQueryStats()
|
LuxSearcher |
getSearcher()
|
XmlQueryParser |
getXmlQueryParser()
|
void |
reopenSearcher()
reopen the searcher so it sees any updates. |
void |
setQueryStats(QueryStats queryStats)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LUX_NAMESPACE
| Constructor Detail |
|---|
public Evaluator(Compiler compiler,
LuxSearcher searcher,
DocWriter docWriter)
compiler - queries are compiled using thissearcher - search operations required by evaluated queries are carried out using thisdocWriter - this writer is used to modify the index (write, delete documents). It must
be tied to the same index as the searcher.public Evaluator()
| Method Detail |
|---|
public static Evaluator createEvaluator(org.apache.lucene.store.Directory dir)
throws IOException
dir - the directory where documents are to be searched, store and retrieved
IOException - if the Directory cannot be openedpublic void close()
public XdmResultSet evaluate(String query)
query - an XQuery expression (main module)
public XdmResultSet evaluate(String query,
QueryContext context)
public XdmResultSet evaluate(net.sf.saxon.s9api.XQueryExecutable xquery)
xquery - a compiled XQuery expression
public XdmResultSet evaluate(net.sf.saxon.s9api.XQueryExecutable xquery,
QueryContext context)
public net.sf.saxon.s9api.XdmNode build(Reader xml,
String uri)
XdmNode. The document will be given a generated id outside
the space of ids reserved for indexed documents.
xml - the document contenturi - the document uri
LuxException - if any error occurs (such as an XML parse error).public void reopenSearcher()
public Compiler getCompiler()
public CachingDocReader getDocReader()
public DocWriter getDocWriter()
public LuxSearcher getSearcher()
public QueryStats getQueryStats()
public void setQueryStats(QueryStats queryStats)
public LuxQueryParser getLuxQueryParser()
public XmlQueryParser getXmlQueryParser()
public TransformErrorListener getErrorListener()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||