public class Evaluator extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
Evaluator.LuxCollectionURIResolver |
| Modifier and Type | Field and Description |
|---|---|
static String |
LUX_NAMESPACE |
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
net.sf.saxon.s9api.XdmNode |
build(InputStream xml,
String uri)
Build a document as a Saxon
XdmNode. |
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() |
net.sf.saxon.s9api.DocumentBuilder |
getDocBuilder() |
CachingDocReader |
getDocReader() |
DocWriter |
getDocWriter() |
TransformErrorListener |
getErrorListener() |
LuxQueryParser |
getLuxQueryParser() |
QueryContext |
getQueryContext() |
QueryStats |
getQueryStats() |
LuxSearcher |
getSearcher() |
XmlQueryParser |
getXmlQueryParser() |
Iterator<net.sf.saxon.s9api.XdmItem> |
iterator(net.sf.saxon.s9api.XQueryExecutable xquery,
QueryContext context)
Evaluate the already-compiled query
|
void |
reopenSearcher()
reopen the searcher so it sees any updates.
|
void |
setQueryStats(QueryStats queryStats) |
public static final String LUX_NAMESPACE
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()
public static Evaluator createEvaluator(org.apache.lucene.store.Directory dir) throws IOException
dir - the directory where documents are to be searched, store and retrievedIOException - 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 expressionpublic XdmResultSet evaluate(net.sf.saxon.s9api.XQueryExecutable xquery, QueryContext context)
public Iterator<net.sf.saxon.s9api.XdmItem> iterator(net.sf.saxon.s9api.XQueryExecutable xquery, QueryContext context)
xquery - a compiled XQuery expressioncontext - the dynamic query contextpublic 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 uriLuxException - if any error occurs (such as an XML parse error).public net.sf.saxon.s9api.XdmNode build(InputStream 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 uriLuxException - if any error occurs (such as an XML parse error).public void reopenSearcher()
public Compiler getCompiler()
public CachingDocReader getDocReader()
public net.sf.saxon.s9api.DocumentBuilder getDocBuilder()
public DocWriter getDocWriter()
public LuxSearcher getSearcher()
public QueryStats getQueryStats()
public void setQueryStats(QueryStats queryStats)
public LuxQueryParser getLuxQueryParser()
public XmlQueryParser getXmlQueryParser()
public TransformErrorListener getErrorListener()
public QueryContext getQueryContext()
Copyright © 2013. All Rights Reserved.