Package org.apache.solr.common
Class SolrDocumentBase<T,K>
- java.lang.Object
- 
- org.apache.solr.common.SolrDocumentBase<T,K>
 
- 
- All Implemented Interfaces:
- Serializable,- Map<String,T>,- MapSerializable,- MapWriter,- NavigableObject,- org.noggit.JSONWriter.Writable
 - Direct Known Subclasses:
- SolrDocument,- SolrInputDocument
 
 public abstract class SolrDocumentBase<T,K> extends Object implements Map<String,T>, Serializable, MapWriter - See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description SolrDocumentBase()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description abstract voidaddChildDocument(K child)abstract voidaddChildDocuments(Collection<K> children)abstract voidaddField(String name, Object value)Add a field to the document.abstract intgetChildDocumentCount()Deprecated.abstract List<K>getChildDocuments()Returns the list of anonymous child documents, or null if none.abstract Collection<String>getFieldNames()Get all field names.abstract ObjectgetFieldValue(String name)Get the first value or collection of values for a given field.abstract Collection<Object>getFieldValues(String name)Get a collection of values for a given field nameabstract booleanhasChildDocuments()Has anonymous children?abstract voidsetField(String name, Object value)Set a field with implied null value for boost.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.util.Mapclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
 - 
Methods inherited from interface org.apache.solr.common.MapWriterappend, jsonStr, toMap, write, writeMap
 - 
Methods inherited from interface org.apache.solr.common.NavigableObject_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
 
- 
 
- 
- 
- 
Method Detail- 
getFieldNamespublic abstract Collection<String> getFieldNames() Get all field names.
 - 
setFieldpublic abstract void setField(String name, Object value) Set a field with implied null value for boost.- Parameters:
- name- name of the field to set
- value- value of the field
 
 - 
addFieldpublic abstract void addField(String name, Object value) Add a field to the document.- Parameters:
- name- 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.
 
 - 
getFieldValuepublic abstract Object getFieldValue(String name) Get the first value or collection of values for a given field.
 - 
getFieldValuespublic abstract Collection<Object> getFieldValues(String name) Get a collection of values for a given field name
 - 
addChildDocumentpublic abstract void addChildDocument(K child) 
 - 
addChildDocumentspublic abstract void addChildDocuments(Collection<K> children) 
 - 
getChildDocumentspublic abstract List<K> getChildDocuments() Returns the list of anonymous child documents, or null if none. There may be other "labelled" child documents found in field values, in which the field name is the label. This may be deprecated in 8.0.
 - 
hasChildDocumentspublic abstract boolean hasChildDocuments() Has anonymous children?
 - 
getChildDocumentCount@Deprecated public abstract int getChildDocumentCount() Deprecated.The anonymous child document count.
 
- 
 
-