Package org.elasticsearch.index.mapper
Class ParseContext.Document
- java.lang.Object
-
- org.elasticsearch.index.mapper.ParseContext.Document
-
- All Implemented Interfaces:
java.lang.Iterable<org.apache.lucene.index.IndexableField>
- Enclosing class:
- ParseContext
public static class ParseContext.Document extends java.lang.Object implements java.lang.Iterable<org.apache.lucene.index.IndexableField>
Fork ofDocument
with additional functionality.
-
-
Constructor Summary
Constructors Constructor Description Document()
-
Method Summary
Modifier and Type Method Description void
add(org.apache.lucene.index.IndexableField field)
void
addWithKey(java.lang.Object key, org.apache.lucene.index.IndexableField field)
Add fields so that they can later be fetched usinggetByKey(Object)
.java.lang.String
get(java.lang.String name)
org.apache.lucene.util.BytesRef
getBinaryValue(java.lang.String name)
org.apache.lucene.index.IndexableField
getByKey(java.lang.Object key)
Get back fields that have been previously added withaddWithKey(Object, IndexableField)
.org.apache.lucene.index.IndexableField
getField(java.lang.String name)
java.util.List<org.apache.lucene.index.IndexableField>
getFields()
org.apache.lucene.index.IndexableField[]
getFields(java.lang.String name)
ParseContext.Document
getParent()
Return the parent document, or null if this is the root document.java.lang.String
getPath()
Return the path associated with this document.java.lang.String
getPrefix()
Return a prefix that all fields in this document should have.java.lang.String[]
getValues(java.lang.String name)
Returns an array of values of the field specified as the method parameter.java.util.Iterator<org.apache.lucene.index.IndexableField>
iterator()
-
-
-
Method Detail
-
getPath
public java.lang.String getPath()
Return the path associated with this document.
-
getPrefix
public java.lang.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 java.util.Iterator<org.apache.lucene.index.IndexableField> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<org.apache.lucene.index.IndexableField>
-
getFields
public java.util.List<org.apache.lucene.index.IndexableField> getFields()
-
add
public void add(org.apache.lucene.index.IndexableField field)
-
addWithKey
public void addWithKey(java.lang.Object key, org.apache.lucene.index.IndexableField field)
Add fields so that they can later be fetched usinggetByKey(Object)
.
-
getByKey
public org.apache.lucene.index.IndexableField getByKey(java.lang.Object key)
Get back fields that have been previously added withaddWithKey(Object, IndexableField)
.
-
getFields
public org.apache.lucene.index.IndexableField[] getFields(java.lang.String name)
-
getValues
public final java.lang.String[] getValues(java.lang.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 org.apache.lucene.index.IndexableField getField(java.lang.String name)
-
get
public java.lang.String get(java.lang.String name)
-
getBinaryValue
public org.apache.lucene.util.BytesRef getBinaryValue(java.lang.String name)
-
-