Skip to content

Commit

Permalink
Adding score metadatas
Browse files Browse the repository at this point in the history
  • Loading branch information
goulven authored and goulven committed Dec 9, 2024
1 parent e4f3399 commit 816c1b4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 16 additions & 2 deletions commons/src/main/java/org/open4goods/commons/model/data/Score.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.open4goods.commons.model.data;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import org.open4goods.commons.exceptions.ValidationException;
Expand All @@ -9,8 +11,6 @@
import org.open4goods.commons.services.StandardiserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import com.fasterxml.jackson.annotation.JsonIgnore;

Expand All @@ -31,6 +31,10 @@ public class Score implements Validable {
/** The relativised cardinalities, relativ mode.**/
private Cardinality relativ;

/**
* Optional metadatas this score could have
*/
private Map<String,String> metadatas = new HashMap<>();



Expand Down Expand Up @@ -272,5 +276,15 @@ public void setValue(Double value) {
}


public Map<String, String> getMetadatas() {
return metadatas;
}


public void setMetadatas(Map<String, String> metadatas) {
this.metadatas = metadatas;
}



}
4 changes: 4 additions & 0 deletions commons/src/main/resources/product-mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@
"scores": {
"dynamic": "true",
"properties": {
"metadatas": {
"type": "object",
"enabled": false
},
"absolute": {
"type": "object",
"enabled": false
Expand Down

0 comments on commit 816c1b4

Please sign in to comment.