优化es商品索引的mapping的促销存储结构(解决促销过多时,mapping explosion问题)
This commit is contained in:
parent
f57a373d47
commit
3c905ffd8b
@ -26,7 +26,6 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author paulG
|
* @author paulG
|
||||||
@ -130,8 +129,6 @@ class EsTest {
|
|||||||
List<EsGoodsIndex> esGoodsIndices = new ArrayList<>();
|
List<EsGoodsIndex> esGoodsIndices = new ArrayList<>();
|
||||||
for (GoodsSku goodsSku : list) {
|
for (GoodsSku goodsSku : list) {
|
||||||
EsGoodsIndex index = new EsGoodsIndex(goodsSku);
|
EsGoodsIndex index = new EsGoodsIndex(goodsSku);
|
||||||
Map<String, Object> goodsCurrentPromotionMap = promotionService.getGoodsPromotionMap(index);
|
|
||||||
index.setPromotionMap(goodsCurrentPromotionMap);
|
|
||||||
esGoodsIndices.add(index);
|
esGoodsIndices.add(index);
|
||||||
cache.put(GoodsSkuService.getStockCacheKey(goodsSku.getId()), goodsSku.getQuantity());
|
cache.put(GoodsSkuService.getStockCacheKey(goodsSku.getId()), goodsSku.getQuantity());
|
||||||
}
|
}
|
||||||
@ -174,7 +171,6 @@ class EsTest {
|
|||||||
@Test
|
@Test
|
||||||
void updateIndex() {
|
void updateIndex() {
|
||||||
EsGoodsIndex byId = esGoodsIndexService.findById("121");
|
EsGoodsIndex byId = esGoodsIndexService.findById("121");
|
||||||
byId.setPromotionMap(null);
|
|
||||||
esGoodsIndexService.updateIndex(byId);
|
esGoodsIndexService.updateIndex(byId);
|
||||||
Assertions.assertTrue(true);
|
Assertions.assertTrue(true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user