public class IndexEnvironment
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
swigCMemOwn |
private long |
swigCPtr |
| Constructor and Description |
|---|
IndexEnvironment() |
IndexEnvironment(long cPtr,
boolean cMemoryOwn) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(java.lang.String fileName)
Add the text in a file to the index and repository.
|
void |
addFile(java.lang.String fileName,
java.lang.String fileClass)
add a file of the specified file class to the index and repository
|
void |
addFileClass(Specification spec)
Add a file class.
|
void |
addFileClass(java.lang.String name,
java.lang.String iterator,
java.lang.String parser,
java.lang.String tokenizer,
java.lang.String startDocTag,
java.lang.String endDocTag,
java.lang.String endMetadataTag,
java.lang.String[] include,
java.lang.String[] exclude,
java.lang.String[] index,
java.lang.String[] metadata,
java.util.Map conflations)
Add parsing information for a file class.
|
int |
addParsedDocument(ParsedDocument document)
add an already parsed document to the index and repository
|
int |
addString(java.lang.String fileName,
java.lang.String fileClass,
java.util.Map metadata)
Adds a string to the index and repository.
|
int |
addString(java.lang.String documentString,
java.lang.String fileClass,
java.util.Map metadata,
TagExtent[] tags)
Adds a string to the index and repository.
|
void |
close()
close the index and repository
|
void |
create(java.lang.String repositoryPath)
create a new index and repository
|
void |
create(java.lang.String repositoryPath,
IndexStatus callback)
create a new index and repository
|
void |
delete() |
void |
deleteDocument(int documentID)
Delete an existing document.
|
int |
documentsIndexed()
Returns the number of documents indexed so far in this session.
|
int |
documentsSeen()
Returns the number of documents considered for indexing,
which is the sum of the documents indexed and the documents
skipped.
|
protected void |
finalize() |
static long |
getCPtr(IndexEnvironment obj) |
Specification |
getFileClassSpec(java.lang.String name)
Get a named file class.
|
void |
open(java.lang.String repositoryPath)
open an existing index and repository
|
void |
open(java.lang.String repositoryPath,
IndexStatus callback)
open an existing index and repository
|
void |
setAnchorTextPath(java.lang.String anchorTextRoot)
Set anchor text root path.
|
void |
setDocumentRoot(java.lang.String documentRoot)
Set the document root path
|
void |
setIndexedFields(java.lang.String[] fieldNames)
Set names of fields to be indexed.
|
void |
setMemory(long memory)
set the amount of memory to use for internal structures
|
void |
setMetadataIndexedFields(java.lang.String[] forward,
java.lang.String[] backward)
Set names of metadata fields to be indexed for fast retrieval.
|
void |
setNormalization(boolean normalize)
set normalization of case and some punctuation; default is true (normalize during indexing and at query time)
|
void |
setNumericField(java.lang.String fieldName,
boolean isNumeric)
Set the numeric property of a field.
|
void |
setNumericField(java.lang.String fieldName,
boolean isNumeric,
java.lang.String parserName)
Set the numeric property of a field.
|
void |
setOffsetAnnotationsPath(java.lang.String offsetAnnotationsRoot)
Set offset annotations root path.
|
void |
setOffsetMetadataPath(java.lang.String offsetMetadataRoot)
Set offset metadata root path.
|
void |
setOrdinalField(java.lang.String fieldName,
boolean isOrdinal)
Set the ordinal property of a field.
|
void |
setParentalField(java.lang.String fieldName,
boolean isParental)
Set the parental property of a field.
|
void |
setStemmer(java.lang.String stemmer)
set the stemmer to use
|
void |
setStopwords(java.lang.String[] stopwords)
set the list of stopwords
|
void |
setStoreDocs(boolean flag)
set the storeDocs flag
|
public IndexEnvironment(long cPtr,
boolean cMemoryOwn)
public IndexEnvironment()
public static long getCPtr(IndexEnvironment obj)
protected void finalize()
finalize in class java.lang.Objectpublic void delete()
public void setDocumentRoot(java.lang.String documentRoot)
throws java.lang.Exception
documentRoot - path to document root.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setAnchorTextPath(java.lang.String anchorTextRoot)
throws java.lang.Exception
anchorTextRoot - path to anchor text root.java.lang.Exception - ifpublic void setOffsetMetadataPath(java.lang.String offsetMetadataRoot)
throws java.lang.Exception
offsetMetadataRoot - path to offset metadata root.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setOffsetAnnotationsPath(java.lang.String offsetAnnotationsRoot)
throws java.lang.Exception
offsetAnnotationsRoot - path to offset annotations root.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void addFileClass(java.lang.String name,
java.lang.String iterator,
java.lang.String parser,
java.lang.String tokenizer,
java.lang.String startDocTag,
java.lang.String endDocTag,
java.lang.String endMetadataTag,
java.lang.String[] include,
java.lang.String[] exclude,
java.lang.String[] index,
java.lang.String[] metadata,
java.util.Map conflations)
throws java.lang.Exception
name - name of this file class, eg trecwebiterator - document iterator for this file classparser - document parser for this file classtokenizer - document tokenizer for this file classstartDocTag - tag indicating start of a documentendDocTag - tag indicating the end of a documentendMetadataTag - tag indicating the end of the metadata fieldsinclude - default tags whose contents should be included in the indexexclude - tags whose contents should be excluded from the indexindex - tags that should be forwarded to the index for tag extentsmetadata - tags whose contents should be indexed as metadataconflations - tags that should be conflatedjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public Specification getFileClassSpec(java.lang.String name) throws java.lang.Exception
name - The name of the file class to retrieve.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void addFileClass(Specification spec) throws java.lang.Exception
spec - The file class to add.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void deleteDocument(int documentID)
throws java.lang.Exception
documentID - The document to delete.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setIndexedFields(java.lang.String[] fieldNames)
throws java.lang.Exception
fieldNames - the list of fields.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setNumericField(java.lang.String fieldName,
boolean isNumeric,
java.lang.String parserName)
throws java.lang.Exception
fieldName - the field.isNumeric - true if the field is a numeric field, false if not.parserName - The name of the Transformation to use to compute the numeric value of the field. Repository currently recognizes the name NumericFieldAnnotator.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setNumericField(java.lang.String fieldName,
boolean isNumeric)
throws java.lang.Exception
fieldName - the field.isNumeric - true if the field is a numeric field, false if not.parserName - The name of the Transformation to use to compute the numeric value of the field. Repository currently recognizes the name NumericFieldAnnotator.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setOrdinalField(java.lang.String fieldName,
boolean isOrdinal)
throws java.lang.Exception
fieldName - the field.isOrdinal - true if the field is an ordinal field, false if not.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setParentalField(java.lang.String fieldName,
boolean isParental)
throws java.lang.Exception
fieldName - the field.isParental - true if the field is a parental field, false if not.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setMetadataIndexedFields(java.lang.String[] forward,
java.lang.String[] backward)
throws java.lang.Exception
forward - the list of fields to forward index.backward - the list of fields to backward index.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setStopwords(java.lang.String[] stopwords)
throws java.lang.Exception
stopwords - the list of stopwordsjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setStemmer(java.lang.String stemmer)
throws java.lang.Exception
stemmer - the stemmer to use. One of krovetz, porterjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setMemory(long memory)
throws java.lang.Exception
memory - the number of bytes to use.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setNormalization(boolean normalize)
throws java.lang.Exception
normalize - True, if text should be normalized, false otherwise.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void setStoreDocs(boolean flag)
throws java.lang.Exception
flag, - false to not store documents in the compressed
collection, true to do so (default)java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void create(java.lang.String repositoryPath,
IndexStatus callback)
throws java.lang.Exception
repositoryPath - the path to the repositorycallback - IndexStatus object to be notified of indexing progress.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void create(java.lang.String repositoryPath)
throws java.lang.Exception
repositoryPath - the path to the repositorycallback - IndexStatus object to be notified of indexing progress.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void open(java.lang.String repositoryPath,
IndexStatus callback)
throws java.lang.Exception
repositoryPath - the path to the repositorycallback - IndexStatus object to be notified of indexing progress.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void open(java.lang.String repositoryPath)
throws java.lang.Exception
repositoryPath - the path to the repositorycallback - IndexStatus object to be notified of indexing progress.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void close()
throws java.lang.Exception
java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void addFile(java.lang.String fileName)
throws java.lang.Exception
fileName - the file to addjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public void addFile(java.lang.String fileName,
java.lang.String fileClass)
throws java.lang.Exception
fileName - the file to addfileClass - the file class to add (eg trecweb).java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public int addString(java.lang.String fileName,
java.lang.String fileClass,
java.util.Map metadata)
throws java.lang.Exception
fileName - the document to addfileClass - the file class to add (eg trecweb).metadata - the metadata pairs associated with the string.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public int addString(java.lang.String documentString,
java.lang.String fileClass,
java.util.Map metadata,
TagExtent[] tags)
throws java.lang.Exception
documentString - the document string to add.fileClass - the file class, signaling which parser to use while processing the document string.metadata - a map of metadata String name to String value.tags - offset annotations to be indexed as field data. The
begin and end values of each TagExtent specify byte (not
character or token) offsets within the document string. These
byte offsets are converted to token offsets after document
string parsing.java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public int addParsedDocument(ParsedDocument document) throws java.lang.Exception
document - the document to addjava.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public int documentsIndexed()
throws java.lang.Exception
java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.public int documentsSeen()
throws java.lang.Exception
java.lang.Exception - if a lemur::api::Exception was thrown by the JNI library.