当前位置: 首页>>代码示例>>Java>>正文


Java ShapeRelation.WITHIN属性代码示例

本文整理汇总了Java中org.elasticsearch.common.geo.ShapeRelation.WITHIN属性的典型用法代码示例。如果您正苦于以下问题:Java ShapeRelation.WITHIN属性的具体用法?Java ShapeRelation.WITHIN怎么用?Java ShapeRelation.WITHIN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.elasticsearch.common.geo.ShapeRelation的用法示例。


在下文中一共展示了ShapeRelation.WITHIN属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: rangeQuery

public Query rangeQuery(String field, Object from, Object to, boolean includeFrom, boolean includeTo,
        ShapeRelation relation, @Nullable DateTimeZone timeZone, @Nullable DateMathParser dateMathParser,
        QueryShardContext context) {
    Number lower = from == null ? minValue() : numberType.parse(from, false);
    Number upper = to == null ? maxValue() : numberType.parse(to, false);
    if (relation == ShapeRelation.WITHIN) {
        return withinQuery(field, lower, upper, includeFrom, includeTo);
    } else if (relation == ShapeRelation.CONTAINS) {
        return containsQuery(field, lower, upper, includeFrom, includeTo);
    }
    return intersectsQuery(field, lower, upper, includeFrom, includeTo);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:RangeFieldMapper.java

示例2: getIntRangeQuery

private Query getIntRangeQuery(ShapeRelation relation, int from, int to, boolean includeLower, boolean includeUpper) {
    int[] lower = new int[] {from + (includeLower ? 0 : 1)};
    int[] upper = new int[] {to - (includeUpper ? 0 : 1)};
    if (relation == ShapeRelation.WITHIN) {
        return IntRangeField.newWithinQuery(FIELDNAME, lower, upper);
    } else if (relation == ShapeRelation.CONTAINS) {
        return IntRangeField.newContainsQuery(FIELDNAME, lower, upper);
    }
    return IntRangeField.newIntersectsQuery(FIELDNAME, lower, upper);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:RangeFieldTypeTests.java

示例3: getLongRangeQuery

private Query getLongRangeQuery(ShapeRelation relation, long from, long to, boolean includeLower, boolean includeUpper) {
    long[] lower = new long[] {from + (includeLower ? 0 : 1)};
    long[] upper = new long[] {to - (includeUpper ? 0 : 1)};
    if (relation == ShapeRelation.WITHIN) {
        return LongRangeField.newWithinQuery(FIELDNAME, lower, upper);
    } else if (relation == ShapeRelation.CONTAINS) {
        return LongRangeField.newContainsQuery(FIELDNAME, lower, upper);
    }
    return LongRangeField.newIntersectsQuery(FIELDNAME, lower, upper);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:RangeFieldTypeTests.java

示例4: getFloatRangeQuery

private Query getFloatRangeQuery(ShapeRelation relation, float from, float to, boolean includeLower, boolean includeUpper) {
    float[] lower = new float[] {includeLower ? from : Math.nextUp(from)};
    float[] upper = new float[] {includeUpper ? to : Math.nextDown(to)};
    if (relation == ShapeRelation.WITHIN) {
        return FloatRangeField.newWithinQuery(FIELDNAME, lower, upper);
    } else if (relation == ShapeRelation.CONTAINS) {
        return FloatRangeField.newContainsQuery(FIELDNAME, lower, upper);
    }
    return FloatRangeField.newIntersectsQuery(FIELDNAME, lower, upper);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:RangeFieldTypeTests.java

示例5: getDoubleRangeQuery

private Query getDoubleRangeQuery(ShapeRelation relation, double from, double to, boolean includeLower, boolean includeUpper) {
    double[] lower = new double[] {includeLower ? from : Math.nextUp(from)};
    double[] upper = new double[] {includeUpper ? to : Math.nextDown(to)};
    if (relation == ShapeRelation.WITHIN) {
        return DoubleRangeField.newWithinQuery(FIELDNAME, lower, upper);
    } else if (relation == ShapeRelation.CONTAINS) {
        return DoubleRangeField.newContainsQuery(FIELDNAME, lower, upper);
    }
    return DoubleRangeField.newIntersectsQuery(FIELDNAME, lower, upper);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:RangeFieldTypeTests.java


注:本文中的org.elasticsearch.common.geo.ShapeRelation.WITHIN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。