Object | +--helma.Search.Index
Instances of this class represent a Lucene search index
located in either a directory on disk or in RAM. This class
provides various methods for modifying the underlying Lucene index.
Defined in Search.js
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |
| Constructor Summary | |
helma.Search.Index(<org.apache.lucene.store.Directory> directory, <org.apache.lucene.analysis.Analyzer> analyzer)
Creates a new instance of helma.Search.Index |
|
| Properties Summary | |
<static> Number |
LOCK_TIMEOUT
Constant containing the number of milliseconds the index will try to create an IndexModifier or IndexWriter in case it is currently locked. |
| Methods Summary | |
void
|
addDocument(<helma.Search.Document> doc)
Adds a document to the index. |
void
|
addDocuments(<java.util.Hashtable|java.util.Vector|Array> docs, mergeFactor)
Adds all documents in the passed collection to this index. |
void
|
addIndexes(<org.apache.lucene.store.Directory> dir )
Merges the indexes passed as argument into this one. |
void
|
close()
Closes the underlying index directory for future operations. |
Boolean
|
create()
Creates a new index. |
org.apache.lucene.analysis.Analyer
|
getAnalyzer()
Returns the analyzer used within this index. |
org.apache.lucene.store.Directory
|
getDirectory()
Returns the directory the underlying Lucene index is located at. |
Array
|
getFieldNames()
Returns an array containing all field names in this index. |
org.apache.lucene.index.IndexModifier
|
getModifier(create)
Returns an IndexModifier instance for adding or deleting documents to resp. |
org.apache.lucene.index.IndexReader
|
getReader()
Returns an IndexReader instance. |
helma.Search.Searcher
|
getSearcher()
Returns a searcher for querying this index. |
org.apache.lucene.index.IndexWriter
|
getWriter(create)
Returns an IndexWriter instance that can be used to add documents to the underlying index or to perform various other modifying operations. |
Boolean
|
isLocked()
Checks if the index is locked. |
void
|
optimize()
Optimizes the underlying index. |
Number
|
removeDocument(<String> fieldName, <String> fieldValue)
Remove those documents from the index whose field-value with the given name matches the passed value argument. |
Array
|
removeDocuments(<String> fieldName, <java.util.Hashtable|java.util.Vector|Array> values)
Removes all documents whose field with the given name matches the values passed as argument. |
Number
|
size()
Returns the number of documents in this index. |
void
|
unlock()
Unlocks the index. |
void
|
updateDocument(<helma.Search.Document> docObj, <String> fieldName)
Updates the index with the document passed as argument. |
| Constructor Detail |
helma.Search.Index(<org.apache.lucene.store.Directory> directory, <org.apache.lucene.analysis.Analyzer> analyzer)
directory - The directory where the Lucene index is located at.
analyzer - The analyzer to use when modifying the index.
| Properties Detail |
<static> Number LOCK_TIMEOUT
| Method Detail |
void addDocument(<helma.Search.Document> doc)
doc - The document to add to the index.
void addDocuments(<java.util.Hashtable|java.util.Vector|Array> docs, mergeFactor)
docs - The documents to add to the index.
void addIndexes(<org.apache.lucene.store.Directory> dir )
dir - At least one index director to add to this index.
void close()
Boolean create()
org.apache.lucene.analysis.Analyer getAnalyzer()
org.apache.lucene.store.Directory getDirectory()
Array getFieldNames()
org.apache.lucene.index.IndexModifier getModifier(create)
org.apache.lucene.index.IndexReader getReader()
helma.Search.Searcher getSearcher()
org.apache.lucene.index.IndexWriter getWriter(create)
Boolean isLocked()
void optimize()
Number removeDocument(<String> fieldName, <String> fieldValue)
fieldName - The name of the field
fieldValue - The value of the field.
Array removeDocuments(<String> fieldName, <java.util.Hashtable|java.util.Vector|Array> values)
fieldName - The name of the field
values - The values that define the documents that should be removed from the index.
Number size()
void unlock()
void updateDocument(<helma.Search.Document> docObj, <String> fieldName)
docObj - Document object to add to index.
fieldName - The name of the identifier field.
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |