com.algolia.model.querysuggestions.SourceIndex Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of algoliasearch Show documentation
Show all versions of algoliasearch Show documentation
Java client for Algolia Search API
The newest version!
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost
// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
package com.algolia.model.querysuggestions;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/** Configuration of an Algolia index for Query Suggestions. */
public class SourceIndex {
@JsonProperty("indexName")
private String indexName;
@JsonProperty("replicas")
private Boolean replicas;
@JsonProperty("analyticsTags")
private List analyticsTags;
@JsonProperty("facets")
private List facets;
@JsonProperty("minHits")
private Integer minHits;
@JsonProperty("minLetters")
private Integer minLetters;
@JsonProperty("generate")
private List> generate;
@JsonProperty("external")
private List external;
public SourceIndex setIndexName(String indexName) {
this.indexName = indexName;
return this;
}
/** Name of the Algolia index (case-sensitive) to use as source for query suggestions. */
@javax.annotation.Nonnull
public String getIndexName() {
return indexName;
}
public SourceIndex setReplicas(Boolean replicas) {
this.replicas = replicas;
return this;
}
/**
* If true, Query Suggestions uses all replica indices to find popular searches. If false, only
* the primary index is used.
*/
@javax.annotation.Nullable
public Boolean getReplicas() {
return replicas;
}
public SourceIndex setAnalyticsTags(List analyticsTags) {
this.analyticsTags = analyticsTags;
return this;
}
public SourceIndex addAnalyticsTags(String analyticsTagsItem) {
if (this.analyticsTags == null) {
this.analyticsTags = new ArrayList<>();
}
this.analyticsTags.add(analyticsTagsItem);
return this;
}
/** Get analyticsTags */
@javax.annotation.Nullable
public List getAnalyticsTags() {
return analyticsTags;
}
public SourceIndex setFacets(List facets) {
this.facets = facets;
return this;
}
public SourceIndex addFacets(Facet facetsItem) {
if (this.facets == null) {
this.facets = new ArrayList<>();
}
this.facets.add(facetsItem);
return this;
}
/** Get facets */
@javax.annotation.Nullable
public List getFacets() {
return facets;
}
public SourceIndex setMinHits(Integer minHits) {
this.minHits = minHits;
return this;
}
/**
* Minimum number of hits required to be included as a suggestion. A search query must at least
* generate `minHits` search results to be included in the Query Suggestions index. minimum: 0
*/
@javax.annotation.Nullable
public Integer getMinHits() {
return minHits;
}
public SourceIndex setMinLetters(Integer minLetters) {
this.minLetters = minLetters;
return this;
}
/**
* Minimum letters required to be included as a suggestion. A search query must be at least
* `minLetters` long to be included in the Query Suggestions index. minimum: 0
*/
@javax.annotation.Nullable
public Integer getMinLetters() {
return minLetters;
}
public SourceIndex setGenerate(List> generate) {
this.generate = generate;
return this;
}
public SourceIndex addGenerate(List generateItem) {
if (this.generate == null) {
this.generate = new ArrayList<>();
}
this.generate.add(generateItem);
return this;
}
/** Get generate */
@javax.annotation.Nullable
public List> getGenerate() {
return generate;
}
public SourceIndex setExternal(List external) {
this.external = external;
return this;
}
public SourceIndex addExternal(String externalItem) {
if (this.external == null) {
this.external = new ArrayList<>();
}
this.external.add(externalItem);
return this;
}
/** Get external */
@javax.annotation.Nullable
public List getExternal() {
return external;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SourceIndex sourceIndex = (SourceIndex) o;
return (
Objects.equals(this.indexName, sourceIndex.indexName) &&
Objects.equals(this.replicas, sourceIndex.replicas) &&
Objects.equals(this.analyticsTags, sourceIndex.analyticsTags) &&
Objects.equals(this.facets, sourceIndex.facets) &&
Objects.equals(this.minHits, sourceIndex.minHits) &&
Objects.equals(this.minLetters, sourceIndex.minLetters) &&
Objects.equals(this.generate, sourceIndex.generate) &&
Objects.equals(this.external, sourceIndex.external)
);
}
@Override
public int hashCode() {
return Objects.hash(indexName, replicas, analyticsTags, facets, minHits, minLetters, generate, external);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SourceIndex {\n");
sb.append(" indexName: ").append(toIndentedString(indexName)).append("\n");
sb.append(" replicas: ").append(toIndentedString(replicas)).append("\n");
sb.append(" analyticsTags: ").append(toIndentedString(analyticsTags)).append("\n");
sb.append(" facets: ").append(toIndentedString(facets)).append("\n");
sb.append(" minHits: ").append(toIndentedString(minHits)).append("\n");
sb.append(" minLetters: ").append(toIndentedString(minLetters)).append("\n");
sb.append(" generate: ").append(toIndentedString(generate)).append("\n");
sb.append(" external: ").append(toIndentedString(external)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy