有人能举例说明在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());
}
Run Code Online (Sandbox Code Playgroud)
如何使用elasticsearch?
这里有一些我在生成实体中找到的脚本!
我已经尝试过放置Object,q = field:value,弹性格式的数组,并且总是得到空数组.
抱歉英文不好!