Package org.elasticsearch.index.mapper
Class ParseContext.Document
- java.lang.Object
-
- org.elasticsearch.index.mapper.ParseContext.Document
-
- All Implemented Interfaces:
Iterable<IndexableField>
- Enclosing class:
- ParseContext
public static class ParseContext.Document extends Object implements Iterable<IndexableField>
Fork ofDocumentwith additional functionality.
-
-
Constructor Summary
Constructors Constructor Description Document()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(IndexableField field)voidaddWithKey(Object key, IndexableField field)Add fields so that they can later be fetched usinggetByKey(Object).Stringget(String name)BytesRefgetBinaryValue(String name)IndexableFieldgetByKey(Object key)Get back fields that have been previously added withaddWithKey(Object, IndexableField).IndexableFieldgetField(String name)List<IndexableField>getFields()IndexableField[]getFields(String name)ParseContext.DocumentgetParent()Return the parent document, or null if this is the root document.StringgetPath()Return the path associated with this document.StringgetPrefix()Return a prefix that all fields in this document should have.String[]getValues(String name)Returns an array of values of the field specified as the method parameter.Iterator<IndexableField>iterator()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getPath
public String getPath()
Return the path associated with this document.
-
getPrefix
public String getPrefix()
Return a prefix that all fields in this document should have.
-
getParent
public ParseContext.Document getParent()
Return the parent document, or null if this is the root document.
-
iterator
public Iterator<IndexableField> iterator()
- Specified by:
iteratorin interfaceIterable<IndexableField>
-
getFields
public List<IndexableField> getFields()
-
add
public void add(IndexableField field)
-
addWithKey
public void addWithKey(Object key, IndexableField field)
Add fields so that they can later be fetched usinggetByKey(Object).
-
getByKey
public IndexableField getByKey(Object key)
Get back fields that have been previously added withaddWithKey(Object, IndexableField).
-
getFields
public IndexableField[] getFields(String name)
-
getValues
public final String[] getValues(String name)
Returns an array of values of the field specified as the method parameter. This method returns an empty array when there are no matching fields. It never returns null. If you want the actual numeric field instances back, usegetFields().- Parameters:
name- the name of the field- Returns:
- a
String[]of field values
-
getField
public IndexableField getField(String name)
-
-