/** * The to part of the range query. Null indicates unbounded. */ public RangeQueryBuilder to(Object to, boolean includeUpper) { this.to = maybeConvertToBytesRef(to); this.includeUpper = includeUpper; return this; }
/** * The from part of the range query. Null indicates unbounded. * In case lower bound is assigned to a string, we internally convert it to a {@link BytesRef} because * in {@link RangeQueryBuilder} field are later parsed as {@link BytesRef} and we need internal representation * of query to be equal regardless of whether it was created from XContent or via Java API. */ public RangeQueryBuilder from(Object from, boolean includeLower) { this.from = maybeConvertToBytesRef(from); this.includeLower = includeLower; return this; }
/** * The to part of the range query. Null indicates unbounded. */ public RangeQueryBuilder to(Object to, boolean includeUpper) { this.to = maybeConvertToBytesRef(to); this.includeUpper = includeUpper; return this; }
/** * The from part of the range query. Null indicates unbounded. * In case lower bound is assigned to a string, we internally convert it to a {@link BytesRef} because * in {@link RangeQueryBuilder} field are later parsed as {@link BytesRef} and we need internal representation * of query to be equal regardless of whether it was created from XContent or via Java API. */ public RangeQueryBuilder from(Object from, boolean includeLower) { this.from = maybeConvertToBytesRef(from); this.includeLower = includeLower; return this; }
/** * The from part of the range query. Null indicates unbounded. * In case lower bound is assigned to a string, we internally convert it to a {@link BytesRef} because * in {@link RangeQueryBuilder} field are later parsed as {@link BytesRef} and we need internal representation * of query to be equal regardless of whether it was created from XContent or via Java API. */ public RangeQueryBuilder from(Object from, boolean includeLower) { this.from = maybeConvertToBytesRef(from); this.includeLower = includeLower; return this; }
/** * The to part of the range query. Null indicates unbounded. */ public RangeQueryBuilder to(Object to, boolean includeUpper) { this.to = maybeConvertToBytesRef(to); this.includeUpper = includeUpper; return this; }
} else { if (FROM_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); } else if (TO_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); } else if (INCLUDE_LOWER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { includeLower = parser.booleanValue(); boost = parser.floatValue(); } else if (GT_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); includeLower = false; } else if (GTE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); includeLower = true; } else if (LT_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); includeUpper = false; } else if (LTE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); includeUpper = true; } else if (TIME_ZONE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
} else { if (FROM_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); } else if (TO_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); } else if (INCLUDE_LOWER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { includeLower = parser.booleanValue(); boost = parser.floatValue(); } else if (GT_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); includeLower = false; } else if (GTE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); includeLower = true; } else if (LT_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); includeUpper = false; } else if (LTE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); includeUpper = true; } else if (TIME_ZONE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
} else { if (FROM_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); } else if (TO_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); } else if (INCLUDE_LOWER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { includeLower = parser.booleanValue(); boost = parser.floatValue(); } else if (GT_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); includeLower = false; } else if (GTE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { from = maybeConvertToBytesRef(parser.objectBytes()); includeLower = true; } else if (LT_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); includeUpper = false; } else if (LTE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { to = maybeConvertToBytesRef(parser.objectBytes()); includeUpper = true; } else if (TIME_ZONE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {