-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
292 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/dmarket/domain/document/ImgDocument.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.dmarket.domain.document; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
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.FieldType; | ||
|
||
import java.util.Date; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
//@Document(indexName = "product-ngram") | ||
//@Mapping(mappingPath = "elastic/comment-mapping.json") | ||
@JsonIgnoreProperties(ignoreUnknown=true) | ||
public class ImgDocument { | ||
|
||
@Id | ||
@Field(name = "img_id", type = FieldType.Long) | ||
private Long img_id; | ||
@Field(name = "img_address", type = FieldType.Text) | ||
private String img_address; | ||
@Field(name = "product_id", type = FieldType.Long) | ||
private Long product_id; | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/dmarket/domain/document/ProductDocument.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.dmarket.domain.document; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.databind.node.ArrayNode; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
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.FieldType; | ||
|
||
import java.util.Date; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Document(indexName = "product-ngram") | ||
//@Mapping(mappingPath = "elastic/comment-mapping.json") | ||
@JsonIgnoreProperties(ignoreUnknown=true) | ||
public class ProductDocument { | ||
|
||
@Id | ||
@Field(name = "product_id", type = FieldType.Long) | ||
private Long product_id; | ||
@Field(name = "category_id", type = FieldType.Long) | ||
private Long category_id; | ||
@Field(name = "product_brand", type = FieldType.Text) | ||
private String product_brand; | ||
@Field(name = "product_name", type = FieldType.Text) | ||
private String product_name; | ||
@Field(name = "product_price", type = FieldType.Integer) | ||
private Integer product_price; | ||
@Field(name = "product_sale_price", type = FieldType.Integer) | ||
private Integer product_sale_price; | ||
@Field(name = "product_description", type = FieldType.Text) | ||
private String product_description; | ||
@Field(name = "product_rating", type = FieldType.Float) | ||
private Float product_rating; | ||
@Field(name = "product_created_date", type = FieldType.Long) | ||
private Date product_created_date; | ||
@Field(name = "imgs_enriched", type = FieldType.Object) | ||
private ImgDocument imgs_enriched; | ||
@Field(name = "review_enriched", type = FieldType.Nested) | ||
private ArrayNode reviews; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/dmarket/domain/document/ReviewDocument.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.dmarket.domain.document; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.annotation.Id; | ||
import org.springframework.data.elasticsearch.annotations.Field; | ||
import org.springframework.data.elasticsearch.annotations.FieldType; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
//@Document(indexName = "product-ngram") | ||
//@Mapping(mappingPath = "elastic/comment-mapping.json") | ||
@JsonIgnoreProperties(ignoreUnknown=true) | ||
public class ReviewDocument { | ||
|
||
@Id | ||
@Field(name = "review_id", type = FieldType.Long) | ||
private Long review_id; | ||
@Field(name = "product_id", type = FieldType.Long) | ||
private Long product_id; | ||
} |
37 changes: 0 additions & 37 deletions
37
src/main/java/com/dmarket/domain/product/ProductDocument.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.