public class SolrDocument extends Object implements Map<String,Object>, Iterable<Map.Entry<String,Object>>, Serializable
Constructor and Description |
---|
SolrDocument() |
Modifier and Type | Method and Description |
---|---|
void |
addChildDocument(SolrDocument child) |
void |
addChildDocuments(Collection<SolrDocument> childs) |
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() |
List<SolrDocument> |
getChildDocuments()
Returns the list of child documents, or null if none.
|
Collection<String> |
getFieldNames() |
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() |
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() |
public Collection<String> getFieldNames()
keySet()
public void clear()
public boolean removeFields(String name)
public void setField(String name, Object value)
public void addField(String name, Object value)
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)
public Collection<Object> getFieldValues(String name)
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)
public void addChildDocuments(Collection<SolrDocument> childs)
public List<SolrDocument> getChildDocuments()
public boolean hasChildDocuments()
public int getChildDocumentCount()
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.