|
5 | 5 | import com.algolia.search.models.settings.RemoveStopWords; |
6 | 6 | import com.algolia.search.models.settings.TypoTolerance; |
7 | 7 | import com.algolia.search.util.QueryStringUtils; |
8 | | -import com.fasterxml.jackson.annotation.JsonIgnore; |
9 | | -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
10 | | -import com.fasterxml.jackson.annotation.JsonInclude; |
11 | | -import com.fasterxml.jackson.annotation.JsonProperty; |
| 8 | +import com.fasterxml.jackson.annotation.*; |
12 | 9 | import java.io.Serializable; |
| 10 | +import java.util.HashMap; |
13 | 11 | import java.util.List; |
| 12 | +import java.util.Map; |
14 | 13 |
|
15 | 14 | @JsonInclude(JsonInclude.Include.NON_NULL) |
16 | 15 | @JsonIgnoreProperties(ignoreUnknown = true) |
@@ -614,6 +613,23 @@ public T setSumOrFiltersScores(Boolean sumOrFiltersScores) { |
614 | 613 | return getThis(); |
615 | 614 | } |
616 | 615 |
|
| 616 | + @JsonAnyGetter |
| 617 | + public Map<String, Object> getCustomParameters() { |
| 618 | + return customParameters; |
| 619 | + } |
| 620 | + |
| 621 | + @JsonAnySetter |
| 622 | + public T setCustomParameters(Map<String, Object> customSettings) { |
| 623 | + this.customParameters = customSettings; |
| 624 | + return getThis(); |
| 625 | + } |
| 626 | + |
| 627 | + @JsonAnySetter |
| 628 | + public T setCustomParameter(String key, Object value) { |
| 629 | + this.customParameters.put(key, value); |
| 630 | + return getThis(); |
| 631 | + } |
| 632 | + |
617 | 633 | public String toParam() { |
618 | 634 | return QueryStringUtils.buildQueryAsQueryParams(this); |
619 | 635 | } |
@@ -715,4 +731,7 @@ public String toParam() { |
715 | 731 | /* Personalization */ |
716 | 732 | protected Boolean enablePersonalization; |
717 | 733 | protected Integer personalizationImpact; |
| 734 | + |
| 735 | + /* Custom Parameters */ |
| 736 | + protected Map<String, Object> customParameters = new HashMap<>(); |
718 | 737 | } |
0 commit comments