java的elasticsearch做高亮显示
2021-03-04 07:26
标签:ext asm mapper int 设置 tostring catch gre div java的elasticsearch做高亮显示 标签:ext asm mapper int 设置 tostring catch gre div 原文地址:https://www.cnblogs.com/zhian/p/14368652.htmlpublic SearchResult search(String keyWord, Integer page) {
PageRequest pageRequest = PageRequest.of(page - 1, ROWS); //设置分页参数
SearchQuery searchQuery = new NativeSearchQueryBuilder()
.withQuery(QueryBuilders.multiMatchQuery(keyWord, "title", "title.pinyin"
).operator(Operator.AND)) // match查询
.withPageable(pageRequest)
.withHighlightFields(new HighlightBuilder.Field("title")) // 设置高亮
.build();
AggregatedPage
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "haoke", type = "house", createIndex = false)
public class HouseData {
@Id
private String id;
private String title;
private String rent;
private String floor;
private String image;
private String orientation;
private String houseType;
private String rentMethod;
private String time;
}
下一篇:大整数排序
文章标题:java的elasticsearch做高亮显示
文章链接:http://soscw.com/index.php/essay/59879.html