SearchResult result = jestClient.execute(search);
List<Hit<CsdnBlog, Void>> hits = result.getHits(CsdnBlog.class);
System.out.println("Size:" + hits.size());
for (Hit<CsdnBlog, Void> hit : hits) {
CsdnBlog csdnBlog = hit.source;
System.out.println(hit.highlight);
System.out.println(csdnBlog.getId());
}
List<Hit<CsdnBlog, Void>> hits = result.getHits(CsdnBlog.class);
System.out.println("Size:" + hits.size());
for (Hit<CsdnBlog, Void> hit : hits) {
CsdnBlog csdnBlog = hit.source;
System.out.println(hit.highlight);
System.out.println(csdnBlog.getId());
}
2 个回复
novia - 1&0
赞同来自:
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自:
或者分词设置不对。