public class CachingDocReader extends Object
| Constructor and Description |
|---|
CachingDocReader(net.sf.saxon.s9api.DocumentBuilder builder,
net.sf.saxon.Configuration config,
IndexConfiguration indexConfig)
Create a CachingDocReader that will use the provided objects to read and
parse XML documents.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all cached documents.
|
net.sf.saxon.s9api.XdmNode |
createXdmNode(long docID,
String uri,
String xml,
byte[] bytes)
Either the xml or the bytes parameter carries the document contents.
|
net.sf.saxon.s9api.XdmNode |
get(int leafDocID,
org.apache.lucene.index.AtomicReaderContext context)
Reads the document with the given relative id from an atomic reader.
|
net.sf.saxon.s9api.XdmNode |
get(int docID,
org.apache.lucene.index.IndexReader reader)
Reads the document with the given id from a top-level reader.
|
net.sf.saxon.s9api.XdmNode |
get(long docID) |
long |
getBuildTime() |
int |
getCacheHits() |
int |
getCacheMisses() |
public CachingDocReader(net.sf.saxon.s9api.DocumentBuilder builder,
net.sf.saxon.Configuration config,
IndexConfiguration indexConfig)
builder - will be used to construct XML documents as XdmNodesconfig - assigns the proper document ID to each constructed documentindexConfig - supplies the names of the xml storage and uri fieldspublic net.sf.saxon.s9api.XdmNode get(int leafDocID,
org.apache.lucene.index.AtomicReaderContext context)
throws IOException
IndexReader.leafDocID - the relative docid of the document to readcontext - an atomic Lucene index reader context (a leaf of the segmented index tree)IOException - if there is some sort of low-level problem with the indexLuxException - if there is an error building the document that has been retrievedpublic net.sf.saxon.s9api.XdmNode get(int docID,
org.apache.lucene.index.IndexReader reader)
throws IOException
IndexReader.docID - the absolute docid of the document to readreader - the Lucene index readerIOException - if there is some sort of low-level problem with the indexLuxException - if there is an error building the document that has been retrievedpublic net.sf.saxon.s9api.XdmNode get(long docID)
docID - public net.sf.saxon.s9api.XdmNode createXdmNode(long docID,
String uri,
String xml,
byte[] bytes)
docID - The Solr/Lucene docid; or a shard/docid combo under Solr Clouduri - The uri path (no scheme) of the document to createxml - The contents of the document, if an XML documentbytes - The contents of the documentpublic int getCacheHits()
public int getCacheMisses()
public long getBuildTime()
public void clear()
Copyright © 2013. All Rights Reserved.