当前位置:   article > 正文

ElasticSearch如何使用以及java代码如何查询并排序ES中的数据(距离排序)_elasticsearch java 按分排序

elasticsearch java 按分排序

import org.elasticsearch.client.RestHighLevelClient;

import org.elasticsearch.client.transport.TransportClient;

import org.elasticsearch.common.geo.GeoDistance;

import org.elasticsearch.common.settings.Settings;

import org.elasticsearch.common.transport.TransportAddress;

import org.elasticsearch.common.unit.DistanceUnit;

import org.elasticsearch.common.unit.TimeValue;

import org.elasticsearch.common.xcontent.XContentBuilder;

import org.elasticsearch.common.xcontent.XContentFactory;

import org.elasticsearch.index.query.BoolQueryBuilder;

import org.elasticsearch.index.query.GeoDistanceQueryBuilder;

import org.elasticsearch.index.query.GeoValidationMethod;

import org.elasticsearch.index.query.QueryBuilder;

import org.elasticsearch.index.query.QueryBuilders;

import org.elasticsearch.search.SearchHit;

import org.elasticsearch.search.SearchHits;

import org.elasticsearch.search.builder.SearchSourceBuilder;

import org.elasticsearch.search.sort.GeoDistanceSortBuilder;

import org.elasticsearch.search.sort.SortBuilders;

import org.elasticsearch.search.sort.SortOrder;

import org.elasticsearch.transport.client.PreBuiltTransportClient;

import java.io.IOException;

import java.net.InetAddress;

import java.net.UnknownHostException;

<
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/998553
推荐阅读
相关标签
  

闽ICP备14008679号