【发布时间】:2015-07-14 07:48:39
【问题描述】:
谁能给我在 jHipster 或 Spring-boot 中使用 Elasticsearch 的例子吗?
我已经使用 jHipster 生成了实体。有占位符的输入:查询!
/**
* SEARCH /_search/samples/:query -> search for the sample corresponding
* to the query.
*/
@RequestMapping(value = "/_search/samples/{query}",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public List<Sample> search(@PathVariable String query) {
return StreamSupport
.stream(sampleSearchRepository.search(queryString(query)).spliterator(), false)
.collect(Collectors.toList());
}
如何使用elasticsearch?
这是我在生成的实体中找到的一些脚本!
我已经尝试过放置 Object、q=field:value、具有弹性格式的数组,但总是得到空 Array。
抱歉英语不好!
【问题讨论】:
标签: java spring elasticsearch spring-boot jhipster