本文整理汇总了Java中org.elasticsearch.common.geo.ShapeRelation.getRelationByName方法的典型用法代码示例。如果您正苦于以下问题:Java ShapeRelation.getRelationByName方法的具体用法?Java ShapeRelation.getRelationByName怎么用?Java ShapeRelation.getRelationByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.common.geo.ShapeRelation
的用法示例。
在下文中一共展示了ShapeRelation.getRelationByName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RangeQueryBuilder
import org.elasticsearch.common.geo.ShapeRelation; //导入方法依赖的package包/类
/**
* Read from a stream.
*/
public RangeQueryBuilder(StreamInput in) throws IOException {
super(in);
fieldName = in.readString();
from = in.readGenericValue();
to = in.readGenericValue();
includeLower = in.readBoolean();
includeUpper = in.readBoolean();
timeZone = in.readOptionalTimeZone();
String formatString = in.readOptionalString();
if (formatString != null) {
format = Joda.forPattern(formatString);
}
if (in.getVersion().onOrAfter(Version.V_5_2_0_UNRELEASED)) {
String relationString = in.readOptionalString();
if (relationString != null) {
relation = ShapeRelation.getRelationByName(relationString);
}
}
}
示例2: convert
import org.elasticsearch.common.geo.ShapeRelation; //导入方法依赖的package包/类
@Override
public QueryBuilder convert(Filter filter) {
String field = filter.getString("field");
Geometry geometry = filter.get(Geometry.class, "geometry");
String relationName = filter.getString("relation");
ShapeBuilder shapeBuilder = ShapeBuilderUtil.toShapeBuilder(geometry);
ShapeRelation shapeRelation = ShapeRelation.getRelationByName(relationName);
return QueryBuilders.geoShapeQuery(field, shapeBuilder, shapeRelation);
}
示例3: convert
import org.elasticsearch.common.geo.ShapeRelation; //导入方法依赖的package包/类
@Override
public FilterBuilder convert(Filter filter) {
String field = filter.getString("field");
Geometry geometry = filter.get(Geometry.class, "geometry");
String relationName = filter.getString("relation");
ShapeBuilder shapeBuilder = ShapeBuilderUtil.toShapeBuilder(geometry);
ShapeRelation shapeRelation = ShapeRelation.getRelationByName(relationName);
FilterBuilder result = FilterBuilders.geoShapeFilter(field, shapeBuilder, shapeRelation);
return result;
}