Modifier and Type | Field and Description |
---|---|
static boolean |
BLOCK
Indicates update operations will be blocked until the current one returns.
|
static int |
DEFAULT_AND
Use to set the boolean search operator to AND.
|
static int |
DEFAULT_OR
Use to set the boolean search operator to OR.
|
static boolean |
NO_BLOCK
Indicates update operations will be allowed while others are still in progress.
|
Constructor and Description |
---|
SimpleLuceneIndex(java.lang.String indexDirPath)
Initializes or creates an index at the given location using a default search field named "default" and a
StandardAnalyzer for index searching and creation.
|
SimpleLuceneIndex(java.lang.String indexDirPath,
org.apache.lucene.analysis.Analyzer analyzer)
Initializes or creates an index at the given location using a default search field named "default" and
the given Analyzer.
|
SimpleLuceneIndex(java.lang.String indexDirPath,
java.lang.String defaultField,
org.apache.lucene.analysis.Analyzer analyzer)
Initializes or creates an index at the given location using the default search field, additional stop
words and analyzer indicated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addDoc(org.apache.lucene.document.Document doc)
Adds a Document to the index.
|
boolean |
addDoc(org.apache.lucene.document.Document doc,
boolean block)
Adds a Document to the index.
|
boolean |
addDocs(org.apache.lucene.document.Document[] docs)
Adds a group of Documents to the index.
|
boolean |
addDocs(org.apache.lucene.document.Document[] docs,
boolean block)
Adds a group of Documents to the index.
|
void |
close()
Closes the writers and performs clean-up
|
void |
deleteAndReinititlize()
Deletes the index and re-initializes a new, empty one in its place.
|
void |
doWithDocument(Callback cal,
java.lang.String field,
java.lang.String term)
Calls the callback function of cal for each document matching the term in the given field
|
void |
doWithDocument(Callback cal,
java.lang.String field,
java.lang.String[] terms)
Calls the callback function of cal for each document matching the terms in the given field
|
static java.lang.String |
encodeToTerm(java.lang.String s)
Encodes a String to an appropriate format that can be indexed as a single term using a StandardAnalyzer.
|
static java.lang.String |
encodeToTerm(java.lang.String s,
boolean encodeWildCards)
Encodes a String to an appropriate format that can be indexed as a single term using a StandardAnalyzer.
|
static java.lang.String |
encodeToTerm(java.lang.String s,
boolean encodeWildCards,
boolean encodeSpace)
Encodes a String to an appropriate format that can be indexed as a single term or terms using a
StandardAnalyzer.
|
static java.lang.String |
escape(java.lang.String term)
Escapes all Lucene QueryParser reserved characters with a preceeding \.
|
static java.lang.String |
escape(java.lang.String term,
java.lang.String preserveChars)
Escapes the Lucene QueryParser reserved characters with a preceeding \ except those included in
preserveChars.
|
protected void |
finalize()
Override finalize to ensure resources are released...
|
org.apache.lucene.analysis.Analyzer |
getAnalyzer()
Gets the analyzer that has been configured for this index.
|
java.lang.Object |
getAttribute(java.lang.String key)
Gets an attribute from this SimpleLuceneIndex.
|
static java.lang.String |
getDateStamp()
Gets a datestamp of the current time formatted for display with logs and output.
|
java.lang.String |
getDefaultSearchField()
Gets the name of the field that is searched by default if no field is indicated.
|
org.apache.lucene.document.Document |
getDocument(int n)
Gets the nth document in the index.
|
java.util.List |
getFields()
Gets a list of all fields in the index listed alphabetically.
|
java.lang.String |
getIndexLocation()
Gets the ablsolute path to the directory where the index resides.
|
long |
getLastModifiedCount()
Gets the version number of the last time the index was modified by adding, deleting or changing a
document.
|
org.apache.lucene.queryParser.QueryParser.Operator |
getLuceneOperator()
Gets the Lucene boolean operator that is currently being used for searches.
|
static org.apache.lucene.util.Version |
getLuceneVersion()
Gets /the version of Lucene.
|
int |
getNumDocs()
Gets the total number of documents in the index.
|
int |
getNumDocs(org.apache.lucene.search.Query query)
Gets the number of documents that match the given query.
|
int |
getNumDocs(java.lang.String query)
Gets the number of documents that match the given query.
|
int |
getOperator()
Gets the boolean operator that is currently being used for searches.
|
java.lang.String |
getOperatorString()
Gets the boolean operator that is currently being used for searches as a String (AND or OR).
|
org.apache.lucene.queryParser.QueryParser |
getQueryParser()
Gets a new instance of the
QueryParser used by this
SimpleLuceneIndex that uses it's Analyzers, defaultField and boolean operator settings. |
org.apache.lucene.queryParser.QueryParser |
getQueryParser(java.lang.String defaultSearchField)
Gets a new instance of the
QueryParser used by this
SimpleLuceneIndex that uses it's Analyzers and boolean operator settings, allowing one to specify the
default search field. |
org.apache.lucene.index.IndexReader |
getReader()
Gets the IndexReader.
|
java.util.Map |
getTermAndDocCounts(java.lang.String[] fields)
Gets a Map of all terms that are in the index under the given fields.
|
java.util.Map |
getTermCounts()
Gets a Map of all terms that are in the index.
|
java.util.Map |
getTermCounts(java.lang.String field)
Gets a Map of all terms that are in the index under the given field.
|
java.util.Map |
getTermCounts(java.lang.String[] fields)
Gets a Map of all terms that are in the index under the given fields.
|
int |
getTermFrequency(java.lang.String term)
Gets the termFrequency across all fields in the index
|
int |
getTermFrequency(java.lang.String field,
java.lang.String term)
Gets the termFrequency of terms in the given field.
|
java.util.Map |
getTermLists()
Gets a Map of Lists that contain the terms for each field in the index.
|
java.util.List |
getTerms(java.lang.String field)
Gets a list of all terms that are in the index under the given field name.
|
boolean |
isIndexing()
Indicates whether the index is currently being updated or modified.
|
java.util.List |
listDocs()
Gets a list of all
Document s in the index. |
java.util.List |
listDocs(java.lang.String field,
java.lang.String term)
Gets a list of all
Document s in the index that match the given term in
the given field. |
java.util.List |
listDocs(java.lang.String field,
java.lang.String[] terms)
Gets a list of all
Document s in the index that match the given terms
in the given field. |
java.util.List |
listTerms()
Gets a list of all terms in the index.
|
boolean |
removeDocs(java.lang.String field,
java.lang.String value)
Removes all Documents that match the given term within the given field.
|
boolean |
removeDocs(java.lang.String field,
java.lang.String[] values)
Removes all documents that match the given terms within the given field.
|
boolean |
removeDocs(java.lang.String field,
java.lang.String value,
boolean block)
See
removeDocs(String,String) for description. |
ResultDocList |
searchDocs(org.apache.lucene.search.Query query)
Performs a search over the index using the qiven Query using the pre-defined default field, returning an
ordered array of matching ranked results.
|
ResultDocList |
searchDocs(org.apache.lucene.search.Query query,
org.apache.lucene.search.Filter filter)
Performs a search over the index using the qiven Query and Filter using the pre-defined default field,
returning an ordered array of matching ranked results.
|
ResultDocList |
searchDocs(org.apache.lucene.search.Query query,
org.apache.lucene.search.Filter filter,
org.apache.lucene.search.Sort sortBy,
java.util.HashMap docReaderAttributes)
Performs a search over the index using the qiven Query Object and Filter using the pre-defined default
field, returning an ordered array of matching ranked results.
|
ResultDocList |
searchDocs(org.apache.lucene.search.Query query,
java.util.HashMap docReaderAttributes)
Performs a search over the index using the Query object, returning an ordered array of matching ranked
results.
|
ResultDocList |
searchDocs(java.lang.String query)
Performs a search over the index using the qiven query String, returning an ordered array of matching
ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
org.apache.lucene.analysis.Analyzer analyzer)
Performs a search over the index using the qiven query String and Analyzer, returning an ordered array of
matching ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
org.apache.lucene.search.Filter filter)
Performs a search over the index using the qiven query String and Filter using the pre-defined default
field, returning an ordered array of matching ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
org.apache.lucene.search.Filter filter,
java.util.HashMap docReaderAttributes)
Performs a search over the index using the qiven query String and Filter using the pre-defined default
field, returning an ordered array of matching ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
org.apache.lucene.search.Filter filter,
org.apache.lucene.search.Sort sortBy,
java.util.HashMap docReaderAttributes,
org.apache.lucene.analysis.Analyzer analyzer)
Performs a search over the index using the qiven query String and Filter using the pre-defined default
field, returning an ordered array of matching ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
java.util.HashMap docReaderAttributes)
Performs a search over the index using the qiven query String, returning an ordered array of matching
ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
java.util.HashMap docReaderAttributes,
org.apache.lucene.analysis.Analyzer analyzer)
Performs a search over the index using the qiven query String, returning an ordered array of matching
ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
org.apache.lucene.search.Sort sortBy)
Performs a search over the index using the qiven query String, returning an ordered array of matching
ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
java.lang.String defaultField)
Performs a search over the index using the qiven query String, returning an ordered array of matching
ranked results.
|
ResultDocList |
searchDocs(java.lang.String query,
java.lang.String defaultField,
org.apache.lucene.search.Filter filter,
org.apache.lucene.search.Sort sortBy)
Performs a search over the index using the qiven query String, default field and Filter, returning an
ordered array of matching ranked results.
|
void |
setAttribute(java.lang.String key,
java.lang.Object attribute)
Sets an attribute that will be available for access in search results by calling
DocReader.getAttribute(String) or ResultDoc.getAttribute(String) . |
static void |
setDebug(boolean db)
Sets the debug attribute of the SimpleLuceneIndex object
|
void |
setOperator(int operator)
Sets the boolean operator used during searches.
|
void |
stopIndexing()
Instructs the indexer to stop processing updates.
|
boolean |
update(java.lang.String deleteField,
java.util.ArrayList deleteValues,
java.util.ArrayList addDocs)
Updates the index by first deleting the documents that match the value(s) indicated in
deleteValues
in the field deleteField, then adding the documents in addDocs . |
boolean |
update(java.lang.String deleteField,
java.util.ArrayList deleteValues,
java.util.ArrayList addDocs,
boolean block)
Updates the index by first deleting the documents that match the value(s) indicated in
deleteValues
in the field deleteField, then adding the documents in addDocs . |
boolean |
update(java.lang.String deleteField,
java.lang.String[] deleteValues,
org.apache.lucene.document.Document[] addDocs)
Updates the index by first deleting the documents that match the value(s) indicated in
deleteValues
in the field deleteField, then adding the documents in addDocs . |
boolean |
update(java.lang.String deleteField,
java.lang.String[] deleteValues,
org.apache.lucene.document.Document[] addDocs,
boolean block)
Updates the index by first deleting the documents that match the value(s) indicated in
deleteValues
in the field deleteField, then adding the documents in addDocs . |
boolean |
update(java.lang.String deleteField,
java.lang.String deleteValue,
java.util.ArrayList addDocs,
boolean block)
See
update(String, String[], Document[], boolean) for description. |
boolean |
update(java.lang.String deleteField,
java.lang.String deleteValue,
org.apache.lucene.document.Document[] addDocs,
boolean block)
See
update(String, String[], Document[], boolean) for description. |
boolean |
update(java.lang.String deleteField,
java.lang.String deleteValue,
org.apache.lucene.document.Document addDoc,
boolean block)
See
update(String, String[], Document[], boolean) for description. |
public static final boolean BLOCK
public static final boolean NO_BLOCK
public static final int DEFAULT_OR
public static final int DEFAULT_AND
public SimpleLuceneIndex(java.lang.String indexDirPath)
indexDirPath
- The directory where the index is located or will be created.public SimpleLuceneIndex(java.lang.String indexDirPath, org.apache.lucene.analysis.Analyzer analyzer)
indexDirPath
- The directory where the index is located or will be created.analyzer
- The default Analyzer to use for searching and index creationpublic SimpleLuceneIndex(java.lang.String indexDirPath, java.lang.String defaultField, org.apache.lucene.analysis.Analyzer analyzer)
indexDirPath
- The directory where the index is located or will be created.defaultField
- The name of the field used for default searching, for example "default".analyzer
- The default Analyzer to use for searching and index creationpublic void deleteAndReinititlize()
public void setAttribute(java.lang.String key, java.lang.Object attribute)
DocReader.getAttribute(String)
or ResultDoc.getAttribute(String)
.key
- The key used to reference the attribute.attribute
- Any Java Object.ResultDoc.getAttribute(String)
,
DocReader.getAttribute(String)
public java.lang.Object getAttribute(java.lang.String key)
DocReader.getAttribute(String)
or ResultDoc.getAttribute(String)
. The key 'thisIndex' returns this index.key
- The key used to reference the attribute.ResultDoc.getAttribute(String)
,
DocReader.getAttribute(String)
public java.lang.String getIndexLocation()
public ResultDocList searchDocs(java.lang.String query)
query
- The query to perform over the index.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, org.apache.lucene.search.Sort sortBy)
query
- The query to perform over the index.sortBy
- A Sort to apply to the results or null to use relevancy rankingsetOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, org.apache.lucene.analysis.Analyzer analyzer)
query
- The query to perform over the index.analyzer
- The Analyzer to use to determine the tokens in the query.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, java.util.HashMap docReaderAttributes)
query
- The query to perform over the index.docReaderAttributes
- Attributes that are included for use in DocReaders via the ResultDocConfig.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(org.apache.lucene.search.Query query, java.util.HashMap docReaderAttributes)
query
- The Query to search over the index.docReaderAttributes
- Attributes that are included for use in DocReaders via the ResultDocConfig.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, java.util.HashMap docReaderAttributes, org.apache.lucene.analysis.Analyzer analyzer)
query
- The query to perform over the index.docReaderAttributes
- Attributes that are included for use in DocReaders via the ResultDocConfig.analyzer
- The analyzer to use, or null to use the defaultsetOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, java.lang.String defaultField)
query
- The query to perform over the index.defaultField
- The default field to search in.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, java.lang.String defaultField, org.apache.lucene.search.Filter filter, org.apache.lucene.search.Sort sortBy)
query
- The query to perform over the index.defaultField
- The default field to search in, or null to use the pre-defined default field.filter
- A filter used for the search.sortBy
- A Sort to apply to the results or null to use relevancy rankingsetOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, org.apache.lucene.search.Filter filter)
query
- The query to perform over the index.filter
- A filter used for the search.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter)
query
- The Query to perform over the index.filter
- A filter used for the search.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(org.apache.lucene.search.Query query)
query
- The Query to perform over the index.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, org.apache.lucene.search.Filter filter, java.util.HashMap docReaderAttributes)
query
- The query to perform over the index.filter
- A filter used for the search.docReaderAttributes
- Attributes that are included for use in DocReaders via the ResultDocConfig.setOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, org.apache.lucene.search.Sort sortBy, java.util.HashMap docReaderAttributes)
query
- The Query to perform over the index.filter
- A filter used for the search.docReaderAttributes
- Attributes that are included for use in DocReaders via the ResultDocConfig.sortBy
- A Sort to apply to the results or null to use relevancy rankingsetOperator(int operator)
,
getOperator()
public ResultDocList searchDocs(java.lang.String query, org.apache.lucene.search.Filter filter, org.apache.lucene.search.Sort sortBy, java.util.HashMap docReaderAttributes, org.apache.lucene.analysis.Analyzer analyzer)
query
- The query to perform over the index.filter
- A Filter used for the search or null for none.sortBy
- A Sort to apply to the results or null to use relevancy rankingdocReaderAttributes
- Attributes that are included for use in DocReaders via the ResultDocConfig or
null for noneanalyzer
- The analyzer to use, or null to use the defaultsetOperator(int operator)
,
getOperator()
public void setOperator(int operator)
operator
- The new boolean operator value.DEFAULT_OR
,
DEFAULT_AND
public int getOperator()
DEFAULT_OR
,
DEFAULT_AND
public org.apache.lucene.queryParser.QueryParser.Operator getLuceneOperator()
public final org.apache.lucene.queryParser.QueryParser getQueryParser()
QueryParser
used by this
SimpleLuceneIndex that uses it's Analyzers, defaultField and boolean operator settings.public final org.apache.lucene.queryParser.QueryParser getQueryParser(java.lang.String defaultSearchField)
QueryParser
used by this
SimpleLuceneIndex that uses it's Analyzers and boolean operator settings, allowing one to specify the
default search field.defaultSearchField
- The search field used as default when none is specified in the querypublic java.lang.String getOperatorString()
DEFAULT_OR
,
DEFAULT_AND
public java.lang.String getDefaultSearchField()
public org.apache.lucene.index.IndexReader getReader()
public int getNumDocs(java.lang.String query)
query
- The query to perform over the index.public int getNumDocs(org.apache.lucene.search.Query query)
query
- The query to perform over the index.public int getNumDocs()
public java.util.List listDocs()
Document
s in the index. Note: This method loads all
Documents and requires a large amount of memory for large result sets (consider using search instead).public java.util.List listDocs(java.lang.String field, java.lang.String term)
Document
s in the index that match the given term in
the given field. Note: This method loads all Documents and requires a large amount of memory for large
result sets (consider using search instead).field
- The field searched.term
- The term to match.public java.util.List listDocs(java.lang.String field, java.lang.String[] terms)
Document
s in the index that match the given terms
in the given field. Note: This method loads all Documents and requires a large amount of memory for large
result sets (consider using search instead).field
- The field searched.terms
- The terms to match.public void doWithDocument(Callback cal, java.lang.String field, java.lang.String[] terms)
cal
- field
- terms
- public void doWithDocument(Callback cal, java.lang.String field, java.lang.String term)
cal
- field
- term
- public java.util.List listTerms()
public java.util.List getFields()
public java.util.Map getTermLists()
public java.util.List getTerms(java.lang.String field)
getLastModifiedCount()
to determe when to update the cache.field
- The indexed field name.public java.util.Map getTermCounts(java.lang.String field)
Implementation note: this method is not efficient. If you need to use this method frequently, consider
caching the results and using getLastModifiedCount()
to determe when to update the cache.
field
- The indexed field name.public java.util.Map getTermCounts()
Implementation note: this method is not efficient. If you need to use this method frequently, consider
caching the results and using getLastModifiedCount()
to determe when to update the cache.
public final java.util.Map getTermCounts(java.lang.String[] fields)
Implementation note: this method is not efficient. If you need to use this method frequently, consider
caching the results and using getLastModifiedCount()
to determe when to update the cache.
fields
- The indexed field names.public final java.util.Map getTermAndDocCounts(java.lang.String[] fields)
TermDocCount
Objects, which contain the term
count, the total number of documents containing the term in one or more of the given field(s), and a list
of fields in which the term appears.
Implementation note: this method is not efficient. If you need to use this method frequently, consider
caching the results and using getLastModifiedCount()
to determe when to update the cache. Also,
this method is considerably slower when more than one field is requested. This is because an extry query
is required for each term that is found.
fields
- The indexed field names.TermDocCount
Object for all terms in the index under the given
fields.TermDocCount
public int getTermFrequency(java.lang.String term)
term
- The term.public int getTermFrequency(java.lang.String field, java.lang.String term)
field
- The field.term
- The term.public boolean addDoc(org.apache.lucene.document.Document doc)
doc
- The Document to add.public boolean addDoc(org.apache.lucene.document.Document doc, boolean block)
doc
- The Document to add.block
- Indicates whether to block other updates until complete.public boolean addDocs(org.apache.lucene.document.Document[] docs)
docs
- The Documents to add.public boolean addDocs(org.apache.lucene.document.Document[] docs, boolean block)
docs
- The Documents to add.block
- Indicates whether to block other updates until complete.public boolean removeDocs(java.lang.String field, java.lang.String value)
field
- The field that is searched.value
- The term that is matched for deletes.public boolean removeDocs(java.lang.String field, java.lang.String value, boolean block)
removeDocs(String,String)
for description. Adds the ability to control whether blocking
occurs during the update.field
- The field that is searched.value
- The term that is matched for deletes.block
- Indicates whether or not to block other update operations.public boolean removeDocs(java.lang.String field, java.lang.String[] values)
field
- The field that is searched.values
- The terms that are matched for deletes.public boolean update(java.lang.String deleteField, java.lang.String[] deleteValues, org.apache.lucene.document.Document[] addDocs, boolean block)
deleteValues
in the field deleteField,
then adding the documents in addDocs
. Assuming the
deleteField
contains a unique ID for the Document, the Document may be removed by indicating
the ID in the deleteValues
list. To replace an entry in the index for a single item, supply
the item's ID in the deleteValues
list and supply the new Document for the item in the
addDocs
list.deleteField
- The field searched for deleteValues
.deleteValues
- The value matched in deleteField
to indicate which document(s) to
delete.addDocs
- An array of Documents to add to the indexblock
- Indicates whether or not to block other threads or JVMs from read/write from the
index during the delete/add operation.public boolean update(java.lang.String deleteField, java.lang.String[] deleteValues, org.apache.lucene.document.Document[] addDocs)
deleteValues
in the field deleteField,
then adding the documents in addDocs
. See update(String, String[], Document[], boolean)
for description. Performs an update with blocking on.deleteField
- The field searched for deleteValues
.deleteValues
- Array of Strings containing the value matched in deleteField
to
indicate which document(s) to deleteaddDocs
- Array containing Documents to add to the indexpublic boolean update(java.lang.String deleteField, java.lang.String deleteValue, org.apache.lucene.document.Document[] addDocs, boolean block)
update(String, String[], Document[], boolean)
for description.deleteField
- The field searched for deleteValue
.deleteValue
- Matching docs are deleted.addDocs
- These Docs are added to the indexblock
- Block or run in background.public boolean update(java.lang.String deleteField, java.lang.String deleteValue, org.apache.lucene.document.Document addDoc, boolean block)
update(String, String[], Document[], boolean)
for description.deleteField
- The field searched for deleteValue
.deleteValue
- Matching docs are deleted.addDoc
- The Doc to be added to the indexblock
- Block or run in background.public boolean update(java.lang.String deleteField, java.lang.String deleteValue, java.util.ArrayList addDocs, boolean block)
update(String, String[], Document[], boolean)
for description.deleteField
- The field searched for deleteValue
.deleteValue
- Matching docs are deleted.addDocs
- These Docs are added to the indexblock
- Block or run in background.public boolean update(java.lang.String deleteField, java.util.ArrayList deleteValues, java.util.ArrayList addDocs, boolean block)
deleteValues
in the field deleteField,
then adding the documents in addDocs
. See update(String, String[], Document[], boolean)
for description.deleteField
- The field searched for deleteValues
.deleteValues
- ArrayList of Strings containing the value matched in deleteField
to
indicate which document(s) to deleteaddDocs
- An ArrayList containing Documents to add to the indexblock
- Indicates whether or not to block other threads or JVMs from read/write from the
index during the delete/add operation.public boolean update(java.lang.String deleteField, java.util.ArrayList deleteValues, java.util.ArrayList addDocs)
deleteValues
in the field deleteField,
then adding the documents in addDocs
. See update(String, String[], Document[], boolean)
for description. Performs an update with blocking on.deleteField
- The field searched for deleteValues
.deleteValues
- ArrayList of Strings containing the value matched in deleteField
to
indicate which document(s) to deleteaddDocs
- An ArrayList containing Documents to add to the indexpublic long getLastModifiedCount()
public org.apache.lucene.document.Document getDocument(int n)
n
- The document numberpublic boolean isIndexing()
stopIndexing()
public void stopIndexing()
isIndexing()
public final org.apache.lucene.analysis.Analyzer getAnalyzer()
public void close()
protected void finalize()
finalize
in class java.lang.Object
public static final java.lang.String escape(java.lang.String term)
term
- The original StringQueryParser.escape(String)
public static final java.lang.String escape(java.lang.String term, java.lang.String preserveChars)
term
- The original StringpreserveChars
- List of characters NOT to escapeQueryParser.escape(String)
public static final java.lang.String encodeToTerm(java.lang.String s)
Specifically: each letter or number character is left unchanded. All other characters are encoded as the letter 'x' followed by the integer value of the character, for example '@' is encoded as 'x64'.
s
- The string to encode.public static final java.lang.String encodeToTerm(java.lang.String s, boolean encodeWildCards)
Specifically: each letter or number character is left unchanded. All other characters are encoded as the letter 'x' followed by the integer value of the character, for example '@' is encoded as 'x64'.
s
- The string to encode.encodeWildCards
- True to have the '*' char encoded, false to leave it un-encoded.public static final java.lang.String encodeToTerm(java.lang.String s, boolean encodeWildCards, boolean encodeSpace)
Specifically: each letter or number character is left unchanded. All other characters are encoded as the letter 'x' followed by the integer value of the character, for example '@' is encoded as 'x64'.
s
- The string to encode.encodeWildCards
- True to have the '*' char encoded, false to leave it un-encoded.encodeSpace
- True to have the space ' ' char encoded, false to leave it un-encoded.public static org.apache.lucene.util.Version getLuceneVersion()
public static final java.lang.String getDateStamp()
public static void setDebug(boolean db)
db
- The new debug value