Commit 90d5f431 authored by Quxl's avatar Quxl

搜索引擎优化

parent 6d2166d2
......@@ -10,6 +10,7 @@ import com.egolm.common.jdbc.Page;
import com.egolm.shop.service.SolrGoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
......@@ -25,8 +26,16 @@ public class SolrGoodsController {
@RequestMapping("query")
@ApiOperation("搜索引擎商品搜索")
@ApiImplicitParams({
@ApiImplicitParam(dataType="long", allowMultiple=false, name="index", value="分页编号"),
@ApiImplicitParam(dataType="long", allowMultiple=false, name="size", value="分页大小"),
@ApiImplicitParam(dataType="string", allowMultiple=false, name="queryKey", value="搜索关键字"),
@ApiImplicitParam(dataType="string", allowMultiple=true, name="orders", value="排序关键字"),
@ApiImplicitParam(dataType="string", allowMultiple=true, name="keywords", value="精确搜索条件"),
@ApiImplicitParam(dataType="string", allowMultiple=true, name="facetFields", value="单字段分组字段"),
@ApiImplicitParam(dataType="string", allowMultiple=true, name="facetPivotFields", value="多字段分组字段"),
})
public Object query(Page page, String queryKey, String[] keywords, String[] facetFields, String[] facetPivotFields) {
public Object query(Long index, Long size, String queryKey, String[] orders, String[] keywords, String[] facetFields, String[] facetPivotFields) {
Page page = new Page(index, size, orders);
return service.query(page, queryKey, keywords, facetFields, facetPivotFields);
}
......@@ -41,6 +50,9 @@ public class SolrGoodsController {
@ResponseBody
@RequestMapping("updateByDistrictID")
@ApiOperation("搜索引擎按区域编号更新商品索引")
@ApiImplicitParams({
@ApiImplicitParam(dataType="string", name="sDistrictID", value="区域编号"),
})
public Object updateByDistrictID(String sDistrictID) {
service.update(sDistrictID);
return Rjx.jsonOk();
......
package com.egolm.shop.controller;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment