|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectdk.kb.dup.xsltIndexer.IndexLoader
public class IndexLoader
This class is the glue between the Xalan XSLT processor and Lucene. The various methods of the class are used as function inside the XSLT script which makes the actual job.
| Constructor Summary | |
|---|---|
IndexLoader()
|
|
| Method Summary | |
|---|---|
void |
add_field(java.lang.String field,
java.lang.String value,
java.lang.String storeField,
java.lang.String indexField)
This is the real work horse of the IndexLoader. |
void |
add_xml_field(java.lang.String field,
org.w3c.dom.traversal.NodeIterator valueIterator,
java.lang.String storeField,
java.lang.String indexField)
Similar to add_field, but instead of accepting a text field as arguement it takes a XSLT node-set. |
void |
close_document()
Closes the current Lucene document. |
void |
close_index()
This method used to close the index and optimize it. |
void |
delete_documents(java.lang.String dataSourceField,
java.lang.String dataSourceId)
Deletes all Lucene documents in the index which have "dataSourceId" stored in "dataSourceField". |
java.lang.String |
encode_uri(java.lang.String str)
|
void |
open_document()
Creates a new Lucene document. |
void |
open_index(java.lang.String mode,
java.lang.String directory,
java.lang.String debug)
This method tells the IndexLoader to open an index using a given mode (update or create) in the directory given as an argument either of the --update or --create in the command line. |
void |
setAnalyzer(Analyzer analyzer)
|
void |
setIndexReader(IndexReader reader)
|
void |
setIndexWriter(IndexWriter writer)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IndexLoader()
| Method Detail |
|---|
public void open_index(java.lang.String mode,
java.lang.String directory,
java.lang.String debug)
debug - directory - mode - public void setAnalyzer(Analyzer analyzer)
public void open_document()
public void add_field(java.lang.String field,
java.lang.String value,
java.lang.String storeField,
java.lang.String indexField)
This is the real work horse of the IndexLoader. It adds "value" to "field".
Lucene stores it (for retrieval purposes) if storeField is anything but store.no (typically store.yes) for the readability of the XSL. Please refer to Field.Store in the Lucene javadoc.
The field may be indexed for searching purposes depending on the indexField parameter. It may take any of the following four values: "tokenized" (the default), "index.no", "un_tokenized" and "no_norms". "index.no" would be used for data which shouldn't be used for searching but still are useful for presentation purposes. "tokenized" splits the text in tokens (typically words) that may be searched individually or as strings. "un_tokenized" is used when the text should be searched as a string only. This is the case for a record ID. Please refer to Field.Index in the Lucene javadoc.
indexField - storeField - value - field -
public void add_xml_field(java.lang.String field,
org.w3c.dom.traversal.NodeIterator valueIterator,
java.lang.String storeField,
java.lang.String indexField)
All nodes in a node set are copied to a new XML document having the root element <fragment> ... </fragment>
indexField - storeField - valueIterator - field - public void close_document()
public void close_index()
public void setIndexReader(IndexReader reader)
IndexReader - reader
the IndexReader is now instantiated in the Driver, and is passed to us
Xalan. This gives us a tremendous performance boost.public void setIndexWriter(IndexWriter writer)
IndexWriter - writer
the IndexWriter is now instantiated in the Driver, and is passed to us
Xalan. This gives us a tremendous performance boost.
public void delete_documents(java.lang.String dataSourceField,
java.lang.String dataSourceId)
dataSourceId - dataSourceField - public java.lang.String encode_uri(java.lang.String str)
String - str Any string you want to URI encode
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||