摘要: 这段代码是关于多层聚合和嵌套域的聚合,来源:https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/search/aggregations/bucket/NestedTest... 阅读全文
posted @ 2014-11-14 10:34 wmx3ng 阅读(11664) 评论(0) 推荐(0) 编辑
摘要: 有用的链接:http://stackoverflow.com/questions/12215380/sorting-on-several-fields-in-elasticsearch有的时候,需要自己设定排序,java的一个接口如下: String time1 = ConstValu... 阅读全文
posted @ 2014-11-14 10:11 wmx3ng 阅读(13240) 评论(0) 推荐(1) 编辑
摘要: ElasticSearch(ES)检索后需要结果时,可能通过source接口读出.但是这样的话,返回的结果会很多.在调用search方法时,我们可以添加addfield或addfields方法,仅仅读取需要的域.接口示例如下:1 SearchResponse response = c... 阅读全文
posted @ 2014-11-14 10:05 wmx3ng 阅读(4183) 评论(0) 推荐(0) 编辑