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 ofDocumentwith additional functionality.
-
-
Constructor Summary
Constructors Constructor Description Document()
-
Method Summary
Modifier and Type Method Description voidadd(org.apache.lucene.index.IndexableField field)voidaddWithKey(java.lang.Object key, org.apache.lucene.index.IndexableField field)Add fields so that they can later be fetched usinggetByKey(Object).java.lang.Stringget(java.lang.String name)org.apache.lucene.util.BytesRefgetBinaryValue(java.lang.String name)org.apache.lucene.index.IndexableFieldgetByKey(java.lang.Object key)Get back fields that have been previously added withaddWithKey(Object, IndexableField).org.apache.lucene.index.IndexableFieldgetField(java.lang.String name)java.util.List<org.apache.lucene.index.IndexableField>getFields()org.apache.lucene.index.IndexableField[]getFields(java.lang.String name)ParseContext.DocumentgetParent()Return the parent document, or null if this is the root document.java.lang.StringgetPath()Return the path associated with this document.java.lang.StringgetPrefix()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:
iteratorin 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)
-
-