| | |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.service.EsService; |
| | | import org.springframework.data.elasticsearch.core.SearchHits; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.websocket.server.PathParam; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | EsService esService; |
| | | |
| | | @GetMapping() |
| | | public AjaxResult search(String keyword){ |
| | | public AjaxResult search(@PathParam("keyword") String keyword){ |
| | | List<EsModel> byCondition = esService.findByCondition(keyword); |
| | | return AjaxResult.success(byCondition); |
| | | } |
| | |
| | | |
| | | |
| | | BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); |
| | | // boolQueryBuilder.filter(QueryBuilders.termsQuery("fid", idList)); |
| | | boolQueryBuilder.should(QueryBuilders.matchQuery("ctName",con)); |
| | | boolQueryBuilder.should(QueryBuilders.matchQuery("ctContent",con)); |
| | | boolQueryBuilder.should(QueryBuilders.matchQuery("remark",con)); |
| | |
| | | boolQueryBuilder.should(QueryBuilders.matchQuery("by4",con)); |
| | | boolQueryBuilder.should(QueryBuilders.matchQuery("by6",con)); |
| | | boolQueryBuilder.should(QueryBuilders.matchQuery("by7",con)); |
| | | boolQueryBuilder.filter(QueryBuilders.termsQuery("fid", idList)); |
| | | |
| | | |
| | | NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder() |
| | | .withQuery(boolQueryBuilder); |
| | |
| | | lqw.eq(userId != null, ZProperty::getUserId, userId) |
| | | .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getIncomeName()), ZProperty::getIncomeName, zProperty.getIncomeName()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType()).eq(zProperty.getIsChange()!=null,ZProperty::getIsChange,zProperty.getIsChange()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getIsChange()),ZProperty::getIsChange,zProperty.getIsChange()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getRemark()), ZProperty::getRemark, zProperty.getRemark()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getTimeLimit()),ZProperty::getTimeLimit,zProperty.getTimeLimit()) |
| | | .between(zProperty.getHappenStartTime() != null && zProperty.getHappenEndTime() != null, ZProperty::getHappenTime, zProperty.getHappenStartTime(), zProperty.getHappenEndTime()) |