支持分页、高亮、排序的查询
<p><strong>简要描述:</strong> </p>
<ul>
<li>支持分页、高亮、排序的查询</li>
</ul>
<p><strong>入参:</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">queryBuilder</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">QueryBuilder</td>
<td>要查询的条件</td>
</tr>
<tr>
<td style="text-align: left;">pageSortHighLight</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">PageSortHighLight</td>
<td>分页+高亮对象封装</td>
</tr>
<tr>
<td style="text-align: left;">clazz</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">Class<T></td>
<td>要查询的条件</td>
</tr>
</tbody>
</table>
<p><strong>返回示例</strong></p>
<pre><code> {
"totalPages":0
}</code></pre>
<p><strong>返回参数说明</strong> </p>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">无</td>
<td style="text-align: left;">PageList<T></td>
<td>查询出来的数据封装</td>
</tr>
</tbody>
</table>
<p><strong>示例代码</strong></p>
<pre><code class="language-java">int currentPage = 1;
int pageSize = 10;
//分页
PageSortHighLight psh = new PageSortHighLight(currentPage,pageSize);
//排序
//排序字段,注意如果proposal_no是text类型会默认带有keyword性质,需要拼接.keyword
//精准查询的字段需要设置keyword属性(默认该属性为true),查询时fieldname需要带上.keyword
String sorter = "proposal_no.keyword";
Sort.Order order = new Sort.Order(SortOrder.ASC,sorter);
psh.setSort(new Sort(order));
//定制高亮,如果定制了高亮,返回结果会自动替换字段值为高亮内容
psh.setHighLight(new HighLight().field("appli_name"));
//可以单独定义高亮的格式
//new HighLight().setPreTag("<em>");
//new HighLight().setPostTag("</em>");
PageList<BaoDanModel> pageList = new PageList<>();
pageList = elasticsearchTemplate.search(QueryBuilders.matchQuery("appli_name","阿斯达岁"), psh, BaoDanModel.class);
pageList.getList().forEach(BaoDanModel -> System.out.println(BaoDanModel));</code></pre>
<p><strong>接口</strong></p>
<pre><code class="language-java">/**
* 支持分页、高亮、排序的查询
* @param queryBuilder
* @param pageSortHighLight
* @param clazz
* @return
* @throws Exception
*/
public PageList<T> search(QueryBuilder queryBuilder, PageSortHighLight pageSortHighLight, Class<T> clazz) throws Exception;
</code></pre>