Search in sources :

Example 6 with ScriptField

use of org.elasticsearch.search.builder.SearchSourceBuilder.ScriptField in project elasticsearch by elastic.

the class TopHitsAggregationBuilder method doWriteTo.

@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeBoolean(explain);
    out.writeOptionalWriteable(fetchSourceContext);
    boolean hasFieldDataFields = fieldDataFields != null;
    out.writeBoolean(hasFieldDataFields);
    if (hasFieldDataFields) {
        out.writeVInt(fieldDataFields.size());
        for (String fieldName : fieldDataFields) {
            out.writeString(fieldName);
        }
    }
    out.writeOptionalWriteable(storedFieldsContext);
    out.writeVInt(from);
    out.writeOptionalWriteable(highlightBuilder);
    boolean hasScriptFields = scriptFields != null;
    out.writeBoolean(hasScriptFields);
    if (hasScriptFields) {
        out.writeVInt(scriptFields.size());
        for (ScriptField scriptField : scriptFields) {
            scriptField.writeTo(out);
        }
    }
    out.writeVInt(size);
    boolean hasSorts = sorts != null;
    out.writeBoolean(hasSorts);
    if (hasSorts) {
        out.writeVInt(sorts.size());
        for (SortBuilder<?> sort : sorts) {
            out.writeNamedWriteable(sort);
        }
    }
    out.writeBoolean(trackScores);
    out.writeBoolean(version);
}
Also used : ScriptField(org.elasticsearch.search.builder.SearchSourceBuilder.ScriptField)

Aggregations

ScriptField (org.elasticsearch.search.builder.SearchSourceBuilder.ScriptField)6 SearchScript (org.elasticsearch.script.SearchScript)3 ArrayList (java.util.ArrayList)2 SortAndFormats (org.elasticsearch.search.sort.SortAndFormats)2 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 ParsingException (org.elasticsearch.common.ParsingException)1 XContentParser (org.elasticsearch.common.xcontent.XContentParser)1 Script (org.elasticsearch.script.Script)1 DocValueFieldsContext (org.elasticsearch.search.fetch.subphase.DocValueFieldsContext)1 ScriptFieldsContext (org.elasticsearch.search.fetch.subphase.ScriptFieldsContext)1