public class LuceneMutableSearchEntry extends AbstractMutableSearchEntry
MutableSearchEntry
interface using
lucene as underlying search-engine.Modifier and Type | Field and Description |
---|---|
private org.apache.lucene.document.Document |
document
The lucene document that represents the actual entry.
|
private LuceneFieldManager |
fieldManager
The
LuceneFieldManager . |
private List<Reader> |
readers |
FIELD_CREATOR, FIELD_CUSTOM_ID, FIELD_ID, FIELD_KEYWORDS, FIELD_LANGUAGE, FIELD_SIZE, FIELD_SOURCE, FIELD_TEXT, FIELD_TITLE, FIELD_TYPE, FIELD_URI
Constructor and Description |
---|
LuceneMutableSearchEntry(org.apache.lucene.document.Document document,
LuceneFieldManager fieldManager,
SearchDependencies searchDependencies)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
This method is called to dispose this entry.
|
Iterator<String> |
getFieldNames()
This method gets the names of all
fields that are defined (NOT
null ). |
protected Object |
getFieldRaw(String name) |
org.apache.lucene.document.Document |
getLuceneDocument()
This method gets the unwrapped lucene document.
|
void |
setBoost(double boost)
This method sets the boost of this this entry.
|
void |
setField(String name,
Object value)
This method sets the field with the given
name to the given
value . |
setCreator, setCustomId, setKeywords, setSize, setSource, setText, setTitle, setType, setUri
getField, getField, getSearchDependencies, getSearchFields
equals, getCreator, getCustomId, getFieldAsString, getId, getSize, getSource, getText, getTitle, getType, getUri, hashCode, toString
getLogger
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getCreator, getCustomId, getField, getField, getFieldAsString, getId, getSize, getSource, getText, getTitle, getType, getUri
private final org.apache.lucene.document.Document document
private final LuceneFieldManager fieldManager
LuceneFieldManager
.public LuceneMutableSearchEntry(org.apache.lucene.document.Document document, LuceneFieldManager fieldManager, SearchDependencies searchDependencies)
document
- is the lucene document that represents the actual entry.fieldManager
- is the LuceneFieldManager
.searchDependencies
- are the SearchDependencies
.public org.apache.lucene.document.Document getLuceneDocument()
public void setBoost(double boost)
boost
- is thepublic void setField(String name, Object value)
name
to the given
value
. SearchEntry.FIELD_ID
and doing so will
cause an exception. SearchFieldType
. Additionally
Reader
can be used to index large texts. value
of the type Reader
should only be used
when indexing really large texts. In this case the
mode
has to be
SearchFieldMode.SEARCHABLE
and
type
has to be SearchFieldType.TEXT
(NOT Reader
). Further the Reader
will only
be closed
when the
MutableSearchEntry
has been
added
or
updated
. If you never
write the MutableSearchEntry
to the index for some reason, you are
responsible for closing the reader.name
- is the name of the field. E.g. SearchEntry.FIELD_TEXT
.value
- is the value of the field to set.protected Object getFieldRaw(String name)
getFieldRaw
in class BasicSearchEntry
name
- is the name
of the
requested field.BasicSearchEntry.getField(String)
public Iterator<String> getFieldNames()
fields
that are defined (NOT
null
).public void dispose()
Copyright © 2001–2016 mmm-Team. All rights reserved.