Java Code Examples for org.elasticsearch.common.io.stream.StreamInput#readText()

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readText() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Suggest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    text = in.readText();
    offset = in.readVInt();
    length = in.readVInt();
    int suggestedWords = in.readVInt();
    options = new ArrayList<>(suggestedWords);
    for (int j = 0; j < suggestedWords; j++) {
        O newOption = newOption();
        newOption.readFrom(in);
        options.add(newOption);
    }
}
 
Example 2
Source File: Suggest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    text = in.readText();
    score = in.readFloat();
    highlighted = in.readOptionalText();
    collateMatch = in.readOptionalBoolean();
}
 
Example 3
Source File: SearchShardTarget.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        nodeId = in.readText();
    }
    index = in.readText();
    shardId = in.readVInt();
}
 
Example 4
Source File: HighlightField.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    if (in.readBoolean()) {
        int size = in.readVInt();
        if (size == 0) {
            fragments = Text.EMPTY_ARRAY;
        } else {
            fragments = new Text[size];
            for (int i = 0; i < size; i++) {
                fragments[i] = in.readText();
            }
        }
    }
}
 
Example 5
Source File: PendingClusterTask.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    insertOrder = in.readVLong();
    priority = Priority.readFrom(in);
    source = in.readText();
    timeInQueue = in.readLong();
    executing = in.readBoolean();
}
 
Example 6
Source File: PercolateResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    id = in.readText();
    index = in.readText();
    score = in.readFloat();
    int size = in.readVInt();
    if (size > 0) {
        hl = new HashMap<>(size);
        for (int j = 0; j < size; j++) {
            hl.put(in.readString(), HighlightField.readHighlightField(in));
        }
    }
}
 
Example 7
Source File: PendingClusterTask.java    From crate with Apache License 2.0 5 votes vote down vote up
public PendingClusterTask(StreamInput in) throws IOException {
    insertOrder = in.readVLong();
    priority = Priority.readFrom(in);
    source = in.readText();
    timeInQueue = in.readLong();
    executing = in.readBoolean();
}