你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
ouyangchucai - Elasticsearch中文社区钉钉群号 : 21737292
赞同来自: liuzhen6835
要回复问题请先登录或注册
2 个回复
ouyangchucai - Elasticsearch中文社区钉钉群号 : 21737292
赞同来自: liuzhen6835
Response response = restClient.performRequest("GET", "/index/type/_search?_source=id&sort=time&size=10&q=content:123", Collections.singletonMap("pretty", "true"));
ouyangchucai - Elasticsearch中文社区钉钉群号 : 21737292
赞同来自: liuzhen6835
searchRequest.types(typeName);
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
sourceBuilder.from(0);
sourceBuilder.size(10);
sourceBuilder.timeout(new TimeValue(60, TimeUnit.SECONDS));
//q为Lucene检索表达式, 直接输入关键词匹配_all或者*字段, 字段匹配user:kimchy, 多字段匹配user:kimchy AND message:Elasticsearch
QueryStringQueryBuilder queryStringQueryBuilder = QueryBuilders.queryStringQuery(q); sourceBuilder.query(queryStringQueryBuilder);
searchRequest.source(sourceBuilder);
SearchResponse searchResponse = restHighLevelClient.search(searchRequest);
SearchHits searchHits = searchResponse.getHits();