|
@@ -1,7 +1,11 @@
|
|
|
package com.macro.mall.search.domain;
|
|
|
|
|
|
import com.macro.mall.model.PmsProductAttributeValue;
|
|
|
+import org.springframework.data.annotation.Id;
|
|
|
import org.springframework.data.elasticsearch.annotations.Document;
|
|
|
+import org.springframework.data.elasticsearch.annotations.Field;
|
|
|
+import org.springframework.data.elasticsearch.annotations.FieldIndex;
|
|
|
+import org.springframework.data.elasticsearch.annotations.FieldType;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
import java.math.BigDecimal;
|
|
@@ -11,18 +15,25 @@ import java.util.List;
|
|
|
* 搜索中的商品信息
|
|
|
* Created by macro on 2018/6/19.
|
|
|
*/
|
|
|
-@Document(indexName = "pms", type = "product")
|
|
|
+@Document(indexName = "pms", type = "product",shards = 1,replicas = 0)
|
|
|
public class EsProduct implements Serializable {
|
|
|
private static final long serialVersionUID = -1L;
|
|
|
+ @Id
|
|
|
private Long id;
|
|
|
+ @Field(index = FieldIndex.not_analyzed,type = FieldType.String)
|
|
|
private String productSn;
|
|
|
private Long brandId;
|
|
|
+ @Field(index = FieldIndex.not_analyzed,type = FieldType.String)
|
|
|
private String brandName;
|
|
|
private Long productCategoryId;
|
|
|
+ @Field(index = FieldIndex.not_analyzed,type = FieldType.String)
|
|
|
private String productCategoryName;
|
|
|
private String pic;
|
|
|
+ @Field(analyzer = "ik_max_word",type = FieldType.String)
|
|
|
private String name;
|
|
|
+ @Field(analyzer = "ik_max_word",type = FieldType.String)
|
|
|
private String subTitle;
|
|
|
+ @Field(analyzer = "ik_max_word",type = FieldType.String)
|
|
|
private String keywords;
|
|
|
private BigDecimal price;
|
|
|
private Integer sale;
|