public abstract class AbstractIndexDocument extends Object implements Map<String,IndexField>, Iterable<IndexField>, IndexDocument
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,IndexField> |
fields
The _fields.
|
protected Map<String,Any.ValueType> |
schema
index schema.
|
| Constructor and Description |
|---|
AbstractIndexDocument(Map<String,Any.ValueType> schema,
String dsId)
Instantiates a new abstract document.
|
AbstractIndexDocument(Map<String,Any.ValueType> schema,
String dsId,
Map<String,IndexField> fields)
Instantiates a new abstract document.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addField(String name,
Object value)
Adds a field with the given name, value and boost.
|
void |
clear()
Remove all fields and boosts from the document.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
IndexDocument |
deepCopy()
return a copy of index Document.
|
Set<Map.Entry<String,IndexField>> |
entrySet() |
IndexField |
get(Object key) |
Throwable |
getError()
If there was an error building the document, it is described here.
|
IndexField |
getField(String field)
Gets the field.
|
Collection<String> |
getFieldNames()
Get all field names.
|
Object |
getFieldValue(String name)
Get the first value for a field.
|
Collection<Object> |
getFieldValues(String name)
Get all the values for a field.
|
Status |
getStatus()
Gets the status.
|
boolean |
isEmpty() |
Iterator<IndexField> |
iterator() |
Set<String> |
keySet() |
IndexField |
put(String key,
IndexField value) |
void |
putAll(Map<? extends String,? extends IndexField> t) |
IndexField |
remove(Object key) |
IndexField |
removeField(String name)
Remove a field from the document.
|
IndexDocument |
setError(Throwable error)
Sets the error.
|
void |
setField(String name,
Object value)
Set a field with implied null value for boost.
|
IndexDocument |
setMarked()
Sets the status marked to the index document.
|
IndexDocument |
setOK()
Sets the ok status to the index document.
|
IndexDocument |
setStatus(Status status)
Sets the status.
|
int |
size() |
String |
toString() |
Collection<IndexField> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllforEach, spliteratorprotected final Map<String,IndexField> fields
protected final Map<String,Any.ValueType> schema
public AbstractIndexDocument(Map<String,Any.ValueType> schema, String dsId)
public AbstractIndexDocument(Map<String,Any.ValueType> schema, String dsId, Map<String,IndexField> fields)
fields - the fieldspublic void clear()
clear in interface Map<String,IndexField>public void addField(String name, Object value)
addField in interface IndexDocumentname - Name of the field, should match one of the field names defined under "fields" tag in schema.xml.value - Value of the field, should be of same class type as defined by "type" attribute of the corresponding field in schema.xml.IndexDocument.addField(java.lang.String, java.lang.Object)public Object getFieldValue(String name)
getFieldValue in interface IndexDocumentname - name of the field to fetchIndexDocument.getFieldValue(java.lang.String)public IndexField getField(String field)
getField in interface IndexDocumentfield - the fieldIndexDocument.getField(java.lang.String)public Collection<Object> getFieldValues(String name)
getFieldValues in interface IndexDocumentname - name of the field to fetchIndexDocument.getFieldValues(java.lang.String)public Collection<String> getFieldNames()
getFieldNames in interface IndexDocumentIndexDocument.getFieldNames()public void setField(String name, Object value)
setField in interface IndexDocumentname - name of the field to setvalue - value of the fieldIndexDocument.setField(java.lang.String, java.lang.Object)public IndexField removeField(String name)
removeField in interface IndexDocumentname - The field name whose field is to be removed from the documentIndexDocument.removeField(java.lang.String)public Iterator<IndexField> iterator()
iterator in interface Iterable<IndexField>Iterable.iterator()public String toString()
toString in class ObjectObject.toString()public boolean containsKey(Object key)
containsKey in interface Map<String,IndexField>Map.containsKey(java.lang.Object)public boolean containsValue(Object value)
containsValue in interface Map<String,IndexField>Map.containsValue(java.lang.Object)public Set<Map.Entry<String,IndexField>> entrySet()
entrySet in interface Map<String,IndexField>Map.entrySet()public IndexField get(Object key)
get in interface Map<String,IndexField>Map.get(java.lang.Object)public boolean isEmpty()
isEmpty in interface Map<String,IndexField>Map.isEmpty()public Set<String> keySet()
keySet in interface Map<String,IndexField>Map.keySet()public IndexField put(String key, IndexField value)
put in interface Map<String,IndexField>Map.put(java.lang.Object, java.lang.Object)public void putAll(Map<? extends String,? extends IndexField> t)
putAll in interface Map<String,IndexField>Map.putAll(java.util.Map)public IndexField remove(Object key)
remove in interface Map<String,IndexField>Map.remove(java.lang.Object)public int size()
size in interface Map<String,IndexField>Map.size()public Collection<IndexField> values()
values in interface Map<String,IndexField>Map.values()public Status getStatus()
getStatus in interface IndexDocumentIndexDocument.getStatus()public IndexDocument setStatus(Status status)
setStatus in interface IndexDocumentstatus - the status to setpublic IndexDocument deepCopy()
deepCopy in interface IndexDocumentIndexDocument.deepCopy()public Throwable getError()
getError in interface IndexDocumentIndexDocument.getError()public IndexDocument setOK()
setOK in interface IndexDocumentIndexDocument.setOK()public IndexDocument setMarked()
setMarked in interface IndexDocumentIndexDocument.setMarked()public IndexDocument setError(Throwable error)
setError in interface IndexDocumenterror - the errorIndexDocument.setError(java.lang.Throwable)Copyright © 2017. All rights reserved.