public float[] readFloatArray() throws IOException { int length = readArraySize(); float[] values = new float[length]; for (int i = 0; i < length; i++) { values[i] = readFloat(); } return values; }
/** * Read from a stream. */ public DisMaxQueryBuilder(StreamInput in) throws IOException { super(in); queries.addAll(readQueries(in)); tieBreaker = in.readFloat(); }
IndexBoost(StreamInput in) throws IOException { index = in.readString(); boost = in.readFloat(); }
protected AbstractQueryBuilder(StreamInput in) throws IOException { boost = in.readFloat(); queryName = in.readOptionalString(); }
/** * Read from a stream. */ public BoostingQueryBuilder(StreamInput in) throws IOException { super(in); positiveQuery = in.readNamedWriteable(QueryBuilder.class); negativeQuery = in.readNamedWriteable(QueryBuilder.class); negativeBoost = in.readFloat(); }
@Nullable public Float readOptionalFloat() throws IOException { if (readBoolean()) { return readFloat(); } return null; }
public static ScoreDoc readScoreDoc(StreamInput in) throws IOException { return new ScoreDoc(in.readVInt(), in.readFloat()); }
/** * Read from a stream. */ public TermSuggestionBuilder(StreamInput in) throws IOException { super(in); suggestMode = SuggestMode.readFromStream(in); accuracy = in.readFloat(); sort = SortBy.readFromStream(in); stringDistance = StringDistanceImpl.readFromStream(in); maxEdits = in.readVInt(); maxInspections = in.readVInt(); maxTermFreq = in.readFloat(); prefixLength = in.readVInt(); minWordLength = in.readVInt(); minDocFreq = in.readFloat(); }
/** * Read from a stream. */ public FieldValueFactorFunctionBuilder(StreamInput in) throws IOException { super(in); field = in.readString(); factor = in.readFloat(); missing = in.readOptionalDouble(); modifier = FieldValueFactorFunction.Modifier.readFromStream(in); }
@Override public void readFrom(StreamInput in) throws IOException { text = in.readText(); score = in.readFloat(); highlighted = in.readOptionalText(); collateMatch = in.readOptionalBoolean(); }
/** * Read from a stream. */ public FunctionScoreQueryBuilder(StreamInput in) throws IOException { super(in); query = in.readNamedWriteable(QueryBuilder.class); filterFunctionBuilders = in.readList(FilterFunctionBuilder::new).toArray(new FilterFunctionBuilder[0]); maxBoost = in.readFloat(); minScore = in.readOptionalFloat(); boostMode = in.readOptionalWriteable(CombineFunction::readFromStream); scoreMode = FunctionScoreQuery.ScoreMode.readFromStream(in); }
public static Explanation readExplanation(StreamInput in) throws IOException { boolean match = in.readBoolean(); String description = in.readString(); final Explanation[] subExplanations = new Explanation[in.readVInt()]; for (int i = 0; i < subExplanations.length; ++i) { subExplanations[i] = readExplanation(in); } if (match) { return Explanation.match(in.readFloat(), description, subExplanations); } else { return Explanation.noMatch(description, subExplanations); } }
public static FieldDoc readFieldDoc(StreamInput in) throws IOException { Comparable[] cFields = new Comparable[in.readVInt()]; for (int j = 0; j < cFields.length; j++) { byte type = in.readByte(); if (type == 0) { cFields[j] = null; } else if (type == 1) { cFields[j] = in.readString(); } else if (type == 2) { cFields[j] = in.readInt(); } else if (type == 3) { cFields[j] = in.readLong(); } else if (type == 4) { cFields[j] = in.readFloat(); } else if (type == 5) { cFields[j] = in.readDouble(); } else if (type == 6) { cFields[j] = in.readByte(); } else if (type == 7) { cFields[j] = in.readShort(); } else if (type == 8) { cFields[j] = in.readBoolean(); } else if (type == 9) { cFields[j] = in.readBytesRef(); } else { throw new IOException("Can't match type [" + type + "]"); } } return new FieldDoc(in.readVInt(), in.readFloat(), cFields); }
public static Comparable readSortValue(StreamInput in) throws IOException { byte type = in.readByte(); if (type == 0) { return null; } else if (type == 1) { return in.readString(); } else if (type == 2) { return in.readInt(); } else if (type == 3) { return in.readLong(); } else if (type == 4) { return in.readFloat(); } else if (type == 5) { return in.readDouble(); } else if (type == 6) { return in.readByte(); } else if (type == 7) { return in.readShort(); } else if (type == 8) { return in.readBoolean(); } else if (type == 9) { return in.readBytesRef(); } else { throw new IOException("Can't match type [" + type + "]"); } }
/** * Read from a stream. */ public CommonTermsQueryBuilder(StreamInput in) throws IOException { super(in); fieldName = in.readString(); text = in.readGenericValue(); highFreqOperator = Operator.readFromStream(in); lowFreqOperator = Operator.readFromStream(in); analyzer = in.readOptionalString(); lowFreqMinimumShouldMatch = in.readOptionalString(); highFreqMinimumShouldMatch = in.readOptionalString(); if (in.getVersion().before(Version.V_6_0_0_alpha1)) { in.readBoolean(); // disable_coord } cutoffFrequency = in.readFloat(); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); searchRequest = new SearchRequest(); searchRequest.readFrom(in); abortOnVersionConflict = in.readBoolean(); size = in.readVInt(); refresh = in.readBoolean(); timeout = in.readTimeValue(); activeShardCount = ActiveShardCount.readFrom(in); retryBackoffInitialTime = in.readTimeValue(); maxRetries = in.readVInt(); requestsPerSecond = in.readFloat(); slices = in.readVInt(); }
@Override public void readFrom(StreamInput in) throws IOException { final boolean hasTotalHits; if (in.getVersion().onOrAfter(Version.V_6_0_0_beta1)) { hasTotalHits = in.readBoolean(); } else { hasTotalHits = true; } if (hasTotalHits) { totalHits = in.readVLong(); } else { totalHits = -1; } maxScore = in.readFloat(); int size = in.readVInt(); if (size == 0) { hits = EMPTY; } else { hits = new SearchHit[size]; for (int i = 0; i < hits.length; i++) { hits[i] = SearchHit.readSearchHit(in); } } if (in.getVersion().onOrAfter(Version.V_6_6_0)) { sortFields = in.readOptionalArray(Lucene::readSortField, SortField[]::new); collapseField = in.readOptionalString(); collapseValues = in.readOptionalArray(Lucene::readSortValue, Object[]::new); } }
boostAtt.setBoost(perFieldTermVectorInput.readFloat());
public Status(StreamInput in) throws IOException { if (in.getVersion().onOrAfter(Version.V_5_1_1)) { sliceId = in.readOptionalVInt(); } else { sliceId = null; } total = in.readVLong(); updated = in.readVLong(); created = in.readVLong(); deleted = in.readVLong(); batches = in.readVInt(); versionConflicts = in.readVLong(); noops = in.readVLong(); bulkRetries = in.readVLong(); searchRetries = in.readVLong(); throttled = in.readTimeValue(); requestsPerSecond = in.readFloat(); reasonCancelled = in.readOptionalString(); throttledUntil = in.readTimeValue(); if (in.getVersion().onOrAfter(Version.V_5_1_1)) { sliceStatuses = in.readList(stream -> stream.readOptionalWriteable(StatusOrException::new)); } else { sliceStatuses = emptyList(); } }