Package org.elasticsearch.search.lookup
Class SourceLookup
java.lang.Object
org.elasticsearch.search.lookup.SourceLookup
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)intdocId()entrySet()extractRawValues(String path)Returns the values associated with the path.extractValue(String path, Object nullValue)For the provided path, return its value in the source.filter(FetchSourceContext context)Internal source representation, might be compressed....booleanisEmpty()keySet()voidvoidsetSegmentAndDocument(org.apache.lucene.index.LeafReaderContext context, int docId)voidvoidsetSource(BytesReference source)voidsetSourceContentType(org.elasticsearch.common.xcontent.XContentType sourceContentType)intsize()source()Return the source as a map that will be unchanged when the lookup moves to a different document.sourceAsMap(BytesReference source)Get the source as aMapof java objects.org.elasticsearch.common.xcontent.XContentTypevalues()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
SourceLookup
public SourceLookup()
-
-
Method Details
-
sourceContentType
public org.elasticsearch.common.xcontent.XContentType sourceContentType() -
docId
public int docId() -
source
Return the source as a map that will be unchanged when the lookup moves to a different document.Important: This can lose precision on numbers with a decimal point. It converts numbers like
"n": 1234.567to adoublewhich only has 52 bits of precision in the mantissa. This will come up most frequently when folks write nanosecond precision dates as a decimal number. -
sourceAsMap
public static Map<String,Object> sourceAsMap(BytesReference source) throws ElasticsearchParseExceptionGet the source as aMapof java objects.Important: This can lose precision on numbers with a decimal point. It converts numbers like
"n": 1234.567to adoublewhich only has 52 bits of precision in the mantissa. This will come up most frequently when folks write nanosecond precision dates as a decimal number.- Throws:
ElasticsearchParseException
-
setSegmentAndDocument
public void setSegmentAndDocument(org.apache.lucene.index.LeafReaderContext context, int docId) -
setSource
-
setSourceContentType
public void setSourceContentType(org.elasticsearch.common.xcontent.XContentType sourceContentType) -
setSource
-
internalSourceRef
Internal source representation, might be compressed.... -
extractRawValues
Returns the values associated with the path. Those are "low" level values, and it can handle path expression where an array/list is navigated within. -
extractValue
For the provided path, return its value in the source. Note that in contrast withextractRawValues(java.lang.String), array and object values can be returned.- Parameters:
path- the value's path in the source.nullValue- a value to return if the path exists, but the value is 'null'. This helps in distinguishing between a path that doesn't exist vs. a value of 'null'.- Returns:
- the value associated with the path in the source or 'null' if the path does not exist.
-
filter
-
get
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
keySet
-
values
-
entrySet
-
put
-
remove
-
putAll
-
clear
public void clear()
-