|
|
@@ -12,6 +12,7 @@ import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.search.exception.SearchException;
|
|
|
import com.uas.search.model.PageParams.FilterField;
|
|
|
+import com.uas.search.model.SPage;
|
|
|
import com.uas.search.model.Sort;
|
|
|
import com.uas.search.service.SearchService;
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -60,14 +61,14 @@ public class SearcherServiceImpl implements SearcherService {
|
|
|
@Override
|
|
|
public ModelMap searchKind(String keyword, String field) {
|
|
|
ModelMap map = new ModelMap();
|
|
|
- List<Map<String, Object>> kinds = new ArrayList<>();
|
|
|
+ SPage<Map<String, Object>> kinds = null;
|
|
|
try {
|
|
|
- kinds = searchService.getKinds(keyword);
|
|
|
+ kinds = searchService.getKinds(keyword,1,1024*1024*1024);
|
|
|
} catch (SearchException e) {
|
|
|
throwSystemException(e);
|
|
|
}
|
|
|
- map.put("total", kinds.size());// 结果总数
|
|
|
- map.put("kinds", kinds);
|
|
|
+ map.put("total", kinds.getTotalElement());// 结果总数
|
|
|
+ map.put("kinds", kinds.getContent());
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
@@ -83,14 +84,14 @@ public class SearcherServiceImpl implements SearcherService {
|
|
|
@Override
|
|
|
public ModelMap searchBrand(String keyword, String field) {
|
|
|
ModelMap map = new ModelMap();
|
|
|
- List<Map<String, Object>> brands = new ArrayList<>();
|
|
|
+ SPage<Map<String, Object>> brands = null;
|
|
|
try {
|
|
|
- brands = searchService.getBrands(keyword);
|
|
|
+ brands = searchService.getBrands(keyword,1,1024*1024*1024);
|
|
|
} catch (SearchException e) {
|
|
|
throwSystemException(e);
|
|
|
}
|
|
|
- map.put("brands", brands);// 结果集
|
|
|
- map.put("total", brands.size());// 结果总数
|
|
|
+ map.put("brands", brands.getContent());// 结果集
|
|
|
+ map.put("total", brands.getTotalElement());// 结果总数
|
|
|
return map;
|
|
|
}
|
|
|
|