Commit 967826d6 authored by Matija Obreza's avatar Matija Obreza

ES: Set createdBy, lastModifiedBy to not_analyzed string type

parent 222e0453
......@@ -27,10 +27,11 @@ import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
......@@ -47,7 +48,7 @@ public abstract class AuditedVersionedModel extends VersionedModel {
@CreatedBy
@Column(updatable = false)
@JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no)
@Field(type = FieldType.String, index = FieldIndex.not_analyzed)
@JsonProperty(access = Access.READ_ONLY)
private Long createdBy;
......@@ -61,7 +62,7 @@ public abstract class AuditedVersionedModel extends VersionedModel {
@JsonView(JsonViews.Protected.class)
@LastModifiedBy
@JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no)
@Field(type = FieldType.String, index = FieldIndex.not_analyzed)
@JsonProperty(access = Access.READ_ONLY)
private Long lastModifiedBy;
......
......@@ -20,11 +20,6 @@ import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.genesys.blocks.util.JsonSidConverter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
......@@ -32,6 +27,12 @@ import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import com.fasterxml.jackson.annotation.JsonView;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* The Class AuditedVersionedModelWithoutId.
......@@ -47,7 +48,7 @@ public abstract class AuditedVersionedModelWithoutId extends VersionedModelWitho
@CreatedBy
@Column(updatable = false)
@JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no)
@Field(type = FieldType.String, index = FieldIndex.not_analyzed)
@JsonProperty(access = Access.READ_ONLY)
private Long createdBy;
......@@ -61,7 +62,7 @@ public abstract class AuditedVersionedModelWithoutId extends VersionedModelWitho
@JsonView(JsonViews.Protected.class)
@LastModifiedBy
@JsonSerialize(converter = JsonSidConverter.class)
@Field(index = FieldIndex.no)
@Field(type = FieldType.String, index = FieldIndex.not_analyzed)
@JsonProperty(access = Access.READ_ONLY)
private Long lastModifiedBy;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment