Skip to content

Commit 2715046

Browse files
algolia-botClaraMullermillotp
committed
feat(specs): add facets query parameter available at run time (generated)
algolia/api-clients-automation#5486 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clara Muller <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 22e1b6d commit 2715046

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

algoliasearch/src/main/java/com/algolia/model/composition/FacetOrdering.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
public class FacetOrdering {
1414

1515
@JsonProperty("facets")
16-
private Facets facets;
16+
private IndexSettingsFacets facets;
1717

1818
@JsonProperty("values")
1919
private Map<String, Value> values;
2020

21-
public FacetOrdering setFacets(Facets facets) {
21+
public FacetOrdering setFacets(IndexSettingsFacets facets) {
2222
this.facets = facets;
2323
return this;
2424
}
2525

2626
/** Get facets */
2727
@javax.annotation.Nullable
28-
public Facets getFacets() {
28+
public IndexSettingsFacets getFacets() {
2929
return facets;
3030
}
3131

algoliasearch/src/main/java/com/algolia/model/composition/Facets.java renamed to algoliasearch/src/main/java/com/algolia/model/composition/IndexSettingsFacets.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
import java.util.Objects;
1111

1212
/** Order of facet names. */
13-
public class Facets {
13+
public class IndexSettingsFacets {
1414

1515
@JsonProperty("order")
1616
private List<String> order;
1717

18-
public Facets setOrder(List<String> order) {
18+
public IndexSettingsFacets setOrder(List<String> order) {
1919
this.order = order;
2020
return this;
2121
}
2222

23-
public Facets addOrder(String orderItem) {
23+
public IndexSettingsFacets addOrder(String orderItem) {
2424
if (this.order == null) {
2525
this.order = new ArrayList<>();
2626
}
@@ -45,8 +45,8 @@ public boolean equals(Object o) {
4545
if (o == null || getClass() != o.getClass()) {
4646
return false;
4747
}
48-
Facets facets = (Facets) o;
49-
return Objects.equals(this.order, facets.order);
48+
IndexSettingsFacets indexSettingsFacets = (IndexSettingsFacets) o;
49+
return Objects.equals(this.order, indexSettingsFacets.order);
5050
}
5151

5252
@Override
@@ -57,7 +57,7 @@ public int hashCode() {
5757
@Override
5858
public String toString() {
5959
StringBuilder sb = new StringBuilder();
60-
sb.append("class Facets {\n");
60+
sb.append("class IndexSettingsFacets {\n");
6161
sb.append(" order: ").append(toIndentedString(order)).append("\n");
6262
sb.append("}");
6363
return sb.toString();

algoliasearch/src/main/java/com/algolia/model/composition/Params.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public class Params {
2929
@JsonProperty("relevancyStrictness")
3030
private Integer relevancyStrictness;
3131

32+
@JsonProperty("facets")
33+
private List<String> facets;
34+
3235
@JsonProperty("facetFilters")
3336
private FacetFilters facetFilters;
3437

@@ -171,6 +174,30 @@ public Integer getRelevancyStrictness() {
171174
return relevancyStrictness;
172175
}
173176

177+
public Params setFacets(List<String> facets) {
178+
this.facets = facets;
179+
return this;
180+
}
181+
182+
public Params addFacets(String facetsItem) {
183+
if (this.facets == null) {
184+
this.facets = new ArrayList<>();
185+
}
186+
this.facets.add(facetsItem);
187+
return this;
188+
}
189+
190+
/**
191+
* Facets for which to retrieve facet values that match the search criteria and the number of
192+
* matching facet values To retrieve all facets, use the wildcard character `*`. For more
193+
* information, see
194+
* [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
195+
*/
196+
@javax.annotation.Nullable
197+
public List<String> getFacets() {
198+
return facets;
199+
}
200+
174201
public Params setFacetFilters(FacetFilters facetFilters) {
175202
this.facetFilters = facetFilters;
176203
return this;
@@ -531,6 +558,7 @@ public boolean equals(Object o) {
531558
Objects.equals(this.page, params.page) &&
532559
Objects.equals(this.getRankingInfo, params.getRankingInfo) &&
533560
Objects.equals(this.relevancyStrictness, params.relevancyStrictness) &&
561+
Objects.equals(this.facets, params.facets) &&
534562
Objects.equals(this.facetFilters, params.facetFilters) &&
535563
Objects.equals(this.optionalFilters, params.optionalFilters) &&
536564
Objects.equals(this.numericFilters, params.numericFilters) &&
@@ -564,6 +592,7 @@ public int hashCode() {
564592
page,
565593
getRankingInfo,
566594
relevancyStrictness,
595+
facets,
567596
facetFilters,
568597
optionalFilters,
569598
numericFilters,
@@ -598,6 +627,7 @@ public String toString() {
598627
sb.append(" page: ").append(toIndentedString(page)).append("\n");
599628
sb.append(" getRankingInfo: ").append(toIndentedString(getRankingInfo)).append("\n");
600629
sb.append(" relevancyStrictness: ").append(toIndentedString(relevancyStrictness)).append("\n");
630+
sb.append(" facets: ").append(toIndentedString(facets)).append("\n");
601631
sb.append(" facetFilters: ").append(toIndentedString(facetFilters)).append("\n");
602632
sb.append(" optionalFilters: ").append(toIndentedString(optionalFilters)).append("\n");
603633
sb.append(" numericFilters: ").append(toIndentedString(numericFilters)).append("\n");

0 commit comments

Comments
 (0)