public class MMBaseEntry extends Object implements IndexEntry
| Modifier and Type | Field and Description |
|---|---|
static DateFormat |
DATE_FORMAT |
| Constructor and Description |
|---|
MMBaseEntry(Node node,
Collection<IndexFieldDefinition> fields,
boolean multiLevel,
NodeManager elementManager,
Step elementStep,
Collection<IndexDefinition> subQueries) |
| Modifier and Type | Method and Description |
|---|---|
protected Set<String> |
addStandardKeys(org.apache.lucene.document.Document document)
Adds the standard keys 'number', 'owner', 'builder' and returns a set of the steps which still needs adding to the
document.
|
(package private) void |
addToIndexed(int number,
String fieldName,
String alias)
Add a name of a node with the specified number as having been indexed (so it won't be attempted to index it again)
|
(package private) String |
getFieldDataAsString(Map<String,?> data,
String fieldName)
Return the data of a field as a string.
|
String |
getIdentifier()
The identifier which can be used to retrieve this IndexEntry, and which should uniquely identify it.
|
String |
getKey()
Key to be used for 'sub-queries', this can be the same as
IndexEntry.getIdentifier(), but this is not necessary. |
protected Node |
getNode(IndexFieldDefinition fd) |
protected String |
getRealField(IndexFieldDefinition fd) |
Collection<IndexDefinition> |
getSubDefinitions()
Returns a Collection of 'sub definition', probably copied from the IndexDefinition which produces this entry.
|
void |
index(org.apache.lucene.document.Document document)
Writes this index entry to a lucene
Document. |
(package private) boolean |
isIndexed(int number,
String fieldName,
String alias)
Returns
true if a field of a node indicated by the number has already been indexed. |
protected boolean |
shouldIndex(IndexFieldDefinition fd) |
protected void |
storeData(Map<String,Object> map)
Store data from field in a node into the cursor
|
(package private) void |
storeFieldData(Map<String,Object> data,
String fieldName,
Object value)
Store data for a field to index.
|
(package private) void |
storeFieldTextData(Map<String,Object> data,
String fieldName,
String value)
Store textual data for a field to index.
|
String |
toString() |
public static final DateFormat DATE_FORMAT
MMBaseEntry(Node node, Collection<IndexFieldDefinition> fields, boolean multiLevel, NodeManager elementManager, Step elementStep, Collection<IndexDefinition> subQueries)
public String getIdentifier()
IndexEntrygetIdentifier in interface IndexEntrypublic String getKey()
IndexEntryIndexEntry.getIdentifier(), but this is not necessary.getKey in interface IndexEntryprotected Set<String> addStandardKeys(org.apache.lucene.document.Document document)
public void index(org.apache.lucene.document.Document document)
IndexEntryDocument.
This does not consider sub-definitions. This is done by Indexer using IndexEntry.getSubDefinitions()index in interface IndexEntrypublic Collection<IndexDefinition> getSubDefinitions()
IndexEntrygetSubDefinitions in interface IndexEntryprotected Node getNode(IndexFieldDefinition fd)
protected String getRealField(IndexFieldDefinition fd)
protected boolean shouldIndex(IndexFieldDefinition fd)
protected void storeData(Map<String,Object> map)
map - The map of fieldName/value mappingsvoid storeFieldTextData(Map<String,Object> data, String fieldName, String value)
fieldName - the name of the field used for indexing (the 'as' name of a field where appropriate)value - the textual value to indexdata - The map of fieldName/value mappingsvoid storeFieldData(Map<String,Object> data, String fieldName, Object value)
fieldName - the name of the field used for indexing (the 'as' name of a field where appropriate)value - the value to indexString getFieldDataAsString(Map<String,?> data, String fieldName)
fieldName - the name of the field used for indexing (the 'as' name of a field where appropriate)void addToIndexed(int number,
String fieldName,
String alias)
number - the number of the nodefieldName - the name of the fieldalias - the alias under which the field is indexedboolean isIndexed(int number,
String fieldName,
String alias)
true if a field of a node indicated by the number has already been indexed.number - the number of the nodefieldName - the name of the fieldalias - the alias under which the field is indexedMMBase 1.9-SNAPSHOT - ${javadoctimestamp}