Authored by hugufei

品类页和模糊搜索页自定义标签使用aop缓存

... ... @@ -20,6 +20,7 @@ import com.yoho.search.service.base.SearchDynamicConfigService;
import com.yoho.search.service.base.SearchRequestParams;
import com.yoho.search.service.helper.SearchCommonHelper;
import com.yoho.search.service.helper.SearchKeyWordHelper;
import com.yoho.search.service.scene.aggregations.SceneAggregationsHelper;
import com.yoho.search.service.scene.common.AbstractSceneService;
import com.yoho.search.service.scene.common.SceneProductListService;
import com.yoho.search.service.scene.common.SceneSelectionsService;
... ... @@ -48,6 +49,8 @@ public class FuzzySceneService extends AbstractSceneService {
private IProductIndexService productIndexService;
@Autowired
private IAggRecommendService recommendService;
@Autowired
private SceneAggregationsHelper sceneAggregationsHelper;
private ExecutorService executor = Executors.newFixedThreadPool(100);
... ... @@ -83,7 +86,7 @@ public class FuzzySceneService extends AbstractSceneService {
// 3、获取商品列表
CompletableFuture<SearchApiResult> productListuture = CompletableFuture.supplyAsync(() -> sceneProductListService.productList(this.newParamMap(paramMap)), executor);
// 4、获取自定义标签聚合结果
CompletableFuture<SearchApiResult> customizeTagFuture = CompletableFuture.supplyAsync(() -> productIndexService.aggCustomizeTag(this.newParamMap(paramMap)), executor);
CompletableFuture<SearchApiResult> customizeTagFuture = CompletableFuture.supplyAsync(() -> sceneAggregationsHelper.secneAggCustomizeTag(this.newParamMap(paramMap)), executor);
// 5、获取促销专题
CompletableFuture<List<Object>> recommendPromotionFuture = CompletableFuture.supplyAsync(() -> recommendService.recommendPromotion(this.newParamMap(paramMap)),
executor);
... ...
... ... @@ -100,7 +100,7 @@ public class SortSceneService extends AbstractSceneService {
}
// 3、获取聚合结果
CompletableFuture<SearchApiResult> standardsFuture = CompletableFuture.supplyAsync(() -> sceneAggregationsHelper.sceneAggStandard(this.newParamMap(paramMap)), executorService);
CompletableFuture<SearchApiResult> customizeTagFuture = CompletableFuture.supplyAsync(() -> productIndexService.aggCustomizeTag(this.newParamMap(paramMap)),
CompletableFuture<SearchApiResult> customizeTagFuture = CompletableFuture.supplyAsync(() -> sceneAggregationsHelper.secneAggCustomizeTag(this.newParamMap(paramMap)),
executorService);
CompletableFuture<List<Object>> recommendProductFuture = CompletableFuture.supplyAsync(() -> aggRecommendService.recommendPromotion(this.newParamMap(paramMap)),
executorService);
... ...
... ... @@ -21,8 +21,8 @@ redis.search.proxy.port =6379
redis.search.proxy.auth =
#es.cluster
search.es.cluster.name=yohosearch-dev-5.4.3
search.es.servers=192.168.102.12:9300 192.168.102.13:9300
search.es.cluster.name=yohosearch_test
search.es.servers=192.168.102.209:9300 192.168.102.216:9300
search.index.number_of_replicas=0
search.index.refresh_interval=10s
search.index.translog.flush_threshold_ops=10000
... ...