|
|
|
@ -13,39 +13,58 @@ import java.math.BigDecimal;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 搜索商品的信息
|
|
|
|
|
* 搜索商品的信息实体类。
|
|
|
|
|
* 该类用于在Elasticsearch中存储商品信息,以便进行高效的搜索操作。
|
|
|
|
|
* Created by macro on 2018/6/19.
|
|
|
|
|
*/
|
|
|
|
|
@Data
|
|
|
|
|
@EqualsAndHashCode
|
|
|
|
|
@Document(indexName = "pms")
|
|
|
|
|
@Setting(shards = 1,replicas = 0)
|
|
|
|
|
@Document(indexName = "pms") // 指定Elasticsearch索引名称
|
|
|
|
|
@Setting(shards = 1, replicas = 0) // 设置索引的分片数和副本数
|
|
|
|
|
public class EsProduct implements Serializable {
|
|
|
|
|
private static final long serialVersionUID = -1L;
|
|
|
|
|
@Id
|
|
|
|
|
private Long id;
|
|
|
|
|
@Field(type = FieldType.Keyword)
|
|
|
|
|
private String productSn;
|
|
|
|
|
private Long brandId;
|
|
|
|
|
@Field(type = FieldType.Keyword)
|
|
|
|
|
private String brandName;
|
|
|
|
|
private Long productCategoryId;
|
|
|
|
|
@Field(type = FieldType.Keyword)
|
|
|
|
|
private String productCategoryName;
|
|
|
|
|
private String pic;
|
|
|
|
|
@Field(analyzer = "ik_max_word",type = FieldType.Text)
|
|
|
|
|
private String name;
|
|
|
|
|
@Field(analyzer = "ik_max_word",type = FieldType.Text)
|
|
|
|
|
private String subTitle;
|
|
|
|
|
@Field(analyzer = "ik_max_word",type = FieldType.Text)
|
|
|
|
|
private String keywords;
|
|
|
|
|
private BigDecimal price;
|
|
|
|
|
private Integer sale;
|
|
|
|
|
private Integer newStatus;
|
|
|
|
|
private Integer recommandStatus;
|
|
|
|
|
private Integer stock;
|
|
|
|
|
private Integer promotionType;
|
|
|
|
|
private Integer sort;
|
|
|
|
|
@Field(type = FieldType.Nested, fielddata = true)
|
|
|
|
|
private List<EsProductAttributeValue> attrValueList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Id // 标记为Elasticsearch的文档ID
|
|
|
|
|
private Long id; // 商品ID
|
|
|
|
|
|
|
|
|
|
@Field(type = FieldType.Keyword) // 指定字段类型为Keyword,不分词
|
|
|
|
|
private String productSn; // 商品编号
|
|
|
|
|
|
|
|
|
|
private Long brandId; // 品牌ID
|
|
|
|
|
|
|
|
|
|
@Field(type = FieldType.Keyword) // 指定字段类型为Keyword,不分词
|
|
|
|
|
private String brandName; // 品牌名称
|
|
|
|
|
|
|
|
|
|
private Long productCategoryId; // 产品分类ID
|
|
|
|
|
|
|
|
|
|
@Field(type = FieldType.Keyword) // 指定字段类型为Keyword,不分词
|
|
|
|
|
private String productCategoryName; // 产品分类名称
|
|
|
|
|
|
|
|
|
|
private String pic; // 商品图片
|
|
|
|
|
|
|
|
|
|
@Field(analyzer = "ik_max_word", type = FieldType.Text) // 使用ik_max_word分析器进行分词
|
|
|
|
|
private String name; // 商品名称
|
|
|
|
|
|
|
|
|
|
@Field(analyzer = "ik_max_word", type = FieldType.Text) // 使用ik_max_word分析器进行分词
|
|
|
|
|
private String subTitle; // 商品副标题
|
|
|
|
|
|
|
|
|
|
@Field(analyzer = "ik_max_word", type = FieldType.Text) // 使用ik_max_word分析器进行分词
|
|
|
|
|
private String keywords; // 商品关键词
|
|
|
|
|
|
|
|
|
|
private BigDecimal price; // 商品价格
|
|
|
|
|
|
|
|
|
|
private Integer sale; // 商品销量
|
|
|
|
|
|
|
|
|
|
private Integer newStatus; // 是否为新品
|
|
|
|
|
|
|
|
|
|
private Integer recommandStatus; // 是否推荐
|
|
|
|
|
|
|
|
|
|
private Integer stock; // 库存
|
|
|
|
|
|
|
|
|
|
private Integer promotionType; // 促销类型
|
|
|
|
|
|
|
|
|
|
private Integer sort; // 排序
|
|
|
|
|
|
|
|
|
|
@Field(type = FieldType.Nested, fielddata = true) // 指定字段类型为Nested,支持嵌套查询
|
|
|
|
|
private List<EsProductAttributeValue> attrValueList; // 商品属性值列表
|
|
|
|
|
}
|