Module org.elasticsearch.server
Package org.elasticsearch.script.field
Class AbstractLongDocValuesField
java.lang.Object
org.elasticsearch.script.field.AbstractScriptFieldFactory<Long>
org.elasticsearch.script.field.AbstractLongDocValuesField
- All Implemented Interfaces:
Iterable<Long>
,ScriptDocValues.Supplier<Long>
,DocValuesScriptFieldFactory
,Field<Long>
,ScriptFieldFactory
- Direct Known Subclasses:
LongDocValuesField
,SeqNoDocValuesField
,VersionDocValuesField
public abstract class AbstractLongDocValuesField
extends AbstractScriptFieldFactory<Long>
implements Field<Long>, DocValuesScriptFieldFactory, ScriptDocValues.Supplier<Long>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected final org.apache.lucene.index.SortedNumericDocValues
protected final String
protected ScriptDocValues<?>
protected long[]
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractLongDocValuesField
(org.apache.lucene.index.SortedNumericDocValues input, String name) -
Method Summary
Modifier and TypeMethodDescriptionprotected long
formatLong
(long raw) Override if long has special formatting.long
get
(int index, long defaultValue) Returns the value atindex
as anlong
if it exists, otherwisedefaultValue
.long
get
(long defaultValue) Returns the 0th index value as anlong
if it exists, otherwisedefaultValue
.getInternal
(int index) protected long
getLong
(int index) getName()
Returns the name of this field.boolean
isEmpty()
Returnstrue
if this field has no values, otherwisefalse
.iterator()
protected ScriptDocValues<?>
Override if not usingScriptDocValues.Longs
void
setNextDocId
(int docId) Set the current document ID.int
size()
Returns the number of values this field has.Returns aScriptDocValues
of the appropriate type for this field.Methods inherited from class org.elasticsearch.script.field.AbstractScriptFieldFactory
toScriptField
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
Methods inherited from interface org.elasticsearch.script.field.ScriptFieldFactory
toScriptField
-
Field Details
-
name
-
scriptDocValues
-
input
protected final org.apache.lucene.index.SortedNumericDocValues input -
values
protected long[] values -
count
protected int count
-
-
Constructor Details
-
AbstractLongDocValuesField
public AbstractLongDocValuesField(org.apache.lucene.index.SortedNumericDocValues input, String name)
-
-
Method Details
-
newScriptDocValues
Override if not usingScriptDocValues.Longs
-
formatLong
protected long formatLong(long raw) Override if long has special formatting. -
setNextDocId
Description copied from interface:DocValuesScriptFieldFactory
Set the current document ID.- Specified by:
setNextDocId
in interfaceDocValuesScriptFieldFactory
- Specified by:
setNextDocId
in interfaceScriptDocValues.Supplier<Long>
- Throws:
IOException
-
toScriptDocValues
Description copied from interface:DocValuesScriptFieldFactory
Returns aScriptDocValues
of the appropriate type for this field. This is used to support backwards compatibility for accessing field values through thedoc
variable.- Specified by:
toScriptDocValues
in interfaceDocValuesScriptFieldFactory
-
getInternal
- Specified by:
getInternal
in interfaceScriptDocValues.Supplier<Long>
-
getLong
protected long getLong(int index) -
size
public int size()Description copied from interface:Field
Returns the number of values this field has. -
isEmpty
public boolean isEmpty()Description copied from interface:Field
Returnstrue
if this field has no values, otherwisefalse
. -
getName
Description copied from interface:Field
Returns the name of this field. -
iterator
-
get
public long get(long defaultValue) Returns the 0th index value as anlong
if it exists, otherwisedefaultValue
. -
get
public long get(int index, long defaultValue) Returns the value atindex
as anlong
if it exists, otherwisedefaultValue
.
-