public class SolrDocument extends SolrDocumentBase<Object,SolrDocument> implements Iterable<Map.Entry<String,Object>>
Constructor and Description |
---|
SolrDocument() |
SolrDocument(Map<String,Object> fields) |
Modifier and Type | Method and Description |
---|---|
void |
addChildDocument(SolrDocument child) |
void |
addChildDocuments(Collection<SolrDocument> children) |
void |
addField(String name,
Object value)
This will add a field to the document.
|
void |
clear()
Remove all fields from the document
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,Object>> |
entrySet() |
Object |
get(Object key) |
int |
getChildDocumentCount()
The anonymous child document count.
|
List<SolrDocument> |
getChildDocuments()
Returns the list of anonymous child documents, or null if none.
|
Collection<String> |
getFieldNames()
Get all field names.
|
Object |
getFieldValue(String name)
Get the value or collection of values for a given field.
|
Map<String,Object> |
getFieldValueMap()
Expose a Map interface to the solr fields.
|
Collection<Object> |
getFieldValues(String name)
Get a collection of values for a given field name
|
Map<String,Collection<Object>> |
getFieldValuesMap()
Expose a Map interface to the solr field value collection.
|
Object |
getFirstValue(String name)
returns the first value for a field
|
boolean |
hasChildDocuments()
Has anonymous children?
|
boolean |
isEmpty() |
Iterator<Map.Entry<String,Object>> |
iterator()
Iterate of String->Object keys
|
Set<String> |
keySet() |
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,? extends Object> t) |
Object |
remove(Object key) |
boolean |
removeFields(String name)
Remove all fields with the name
|
void |
setField(String name,
Object value)
Set a field with the given object.
|
int |
size() |
String |
toString() |
Collection<Object> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public Collection<String> getFieldNames()
SolrDocumentBase
getFieldNames
in class SolrDocumentBase<Object,SolrDocument>
keySet()
public void clear()
public boolean removeFields(String name)
public void setField(String name, Object value)
setField
in class SolrDocumentBase<Object,SolrDocument>
name
- name of the field to setvalue
- value of the fieldpublic void addField(String name, Object value)
addField
in class SolrDocumentBase<Object,SolrDocument>
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.public Object getFieldValue(String name)
getFieldValue
in class SolrDocumentBase<Object,SolrDocument>
public Collection<Object> getFieldValues(String name)
getFieldValues
in class SolrDocumentBase<Object,SolrDocument>
public Map<String,Collection<Object>> getFieldValuesMap()
public Map<String,Object> getFieldValueMap()
public boolean containsKey(Object key)
containsKey
in interface Map<String,Object>
public boolean containsValue(Object value)
containsValue
in interface Map<String,Object>
public void addChildDocument(SolrDocument child)
addChildDocument
in class SolrDocumentBase<Object,SolrDocument>
public void addChildDocuments(Collection<SolrDocument> children)
addChildDocuments
in class SolrDocumentBase<Object,SolrDocument>
public List<SolrDocument> getChildDocuments()
SolrDocumentBase
getChildDocuments
in class SolrDocumentBase<Object,SolrDocument>
public boolean hasChildDocuments()
SolrDocumentBase
hasChildDocuments
in class SolrDocumentBase<Object,SolrDocument>
public int getChildDocumentCount()
SolrDocumentBase
getChildDocumentCount
in class SolrDocumentBase<Object,SolrDocument>
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.