public static class ParseContext.Document extends Object implements Iterable<org.apache.lucene.index.IndexableField>
Document
with additional functionality.Constructor and Description |
---|
Document() |
Modifier and Type | Method and Description |
---|---|
void |
add(org.apache.lucene.index.IndexableField field) |
void |
addWithKey(Object key,
org.apache.lucene.index.IndexableField field)
Add fields so that they can later be fetched using
getByKey(Object) . |
String |
get(String name) |
org.apache.lucene.util.BytesRef |
getBinaryValue(String name) |
org.apache.lucene.index.IndexableField |
getByKey(Object key)
Get back fields that have been previously added with
addWithKey(Object, IndexableField) . |
org.apache.lucene.index.IndexableField |
getField(String name) |
List<org.apache.lucene.index.IndexableField> |
getFields() |
org.apache.lucene.index.IndexableField[] |
getFields(String name) |
ParseContext.Document |
getParent()
Return the parent document, or null if this is the root document.
|
String |
getPath()
Return the path associated with this document.
|
String |
getPrefix()
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<org.apache.lucene.index.IndexableField> |
iterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public String getPath()
public String getPrefix()
public ParseContext.Document getParent()
public Iterator<org.apache.lucene.index.IndexableField> iterator()
public List<org.apache.lucene.index.IndexableField> getFields()
public void add(org.apache.lucene.index.IndexableField field)
public void addWithKey(Object key, org.apache.lucene.index.IndexableField field)
getByKey(Object)
.public org.apache.lucene.index.IndexableField getByKey(Object key)
addWithKey(Object, IndexableField)
.public org.apache.lucene.index.IndexableField[] getFields(String name)
public final String[] getValues(String name)
IntField
, LongField
, FloatField
and DoubleField
it returns the string value of the number.
If you want the actual numeric field instances back, use getFields()
.name
- the name of the fieldString[]
of field valuespublic org.apache.lucene.index.IndexableField getField(String name)
public org.apache.lucene.util.BytesRef getBinaryValue(String name)
Copyright © 2009–2016. All rights reserved.