Package com.algolia.search
Class RecommendClient
- java.lang.Object
-
- com.algolia.search.RecommendClient
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class RecommendClient extends Object implements Closeable
Algolia's REST recommend client that wraps an instance of the transporterHttpTransportwhich wraps the HTTP Client This client allows to build typed requests and read typed responses. Requests are made under the Algolia's retry-strategy. This client is intended to be reused, and it's thread-safe.- See Also:
- Algolia.com
-
-
Constructor Summary
Constructors Constructor Description RecommendClient(SearchConfig config, HttpRequester httpRequester)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the underlying Http ClientSearchConfiggetConfig()<T extends RecommendHit>
List<RecommendationsResult<T>>getFrequentlyBoughtTogether(List<FrequentlyBoughtTogetherQuery> requests, Class<T> clazz)Returns frequently bought together recommendations for a specific model and objectID.<T extends RecommendHit>
List<RecommendationsResult<T>>getFrequentlyBoughtTogether(List<FrequentlyBoughtTogetherQuery> requests, Class<T> clazz, RequestOptions requestOptions)Returns frequently bought together recommendations for a specific model and objectID.<T extends RecommendHit>
CompletableFuture<List<RecommendationsResult<T>>>getFrequentlyBoughtTogetherAsync(List<FrequentlyBoughtTogetherQuery> requests, Class<T> clazz)Returns frequently bought together recommendations for a specific model and objectID.<T extends RecommendHit>
CompletableFuture<List<RecommendationsResult<T>>>getFrequentlyBoughtTogetherAsync(List<FrequentlyBoughtTogetherQuery> requests, Class<T> clazz, RequestOptions requestOptions)Returns frequently bought together recommendations for a specific model and objectID.<T extends RecommendHit>
List<RecommendationsResult<T>>getRecommendations(List<RecommendationsQuery> requests, Class<T> clazz)Returns recommendations for a specific model and objectID.<T extends RecommendHit>
List<RecommendationsResult<T>>getRecommendations(List<RecommendationsQuery> requests, Class<T> clazz, RequestOptions requestOptions)Returns recommendations for a specific model and objectID.<T extends RecommendHit>
CompletableFuture<List<RecommendationsResult<T>>>getRecommendationsAsync(List<RecommendationsQuery> requests, Class<T> clazz)Returns recommendations for a specific model and objectID.<T extends RecommendHit>
CompletableFuture<List<RecommendationsResult<T>>>getRecommendationsAsync(List<RecommendationsQuery> requests, Class<T> clazz, RequestOptions requestOptions)Returns recommendations for a specific model and objectID.<T extends RecommendHit>
List<RecommendationsResult<T>>getRelatedProducts(List<RelatedProductsQuery> requests, Class<T> clazz)Returns related products recommendations for a specific model and objectID.<T extends RecommendHit>
List<RecommendationsResult<T>>getRelatedProducts(List<RelatedProductsQuery> requests, Class<T> clazz, RequestOptions requestOptions)Returns related products recommendations for a specific model and objectID.<T extends RecommendHit>
CompletableFuture<List<RecommendationsResult<T>>>getRelatedProductsAsync(List<RelatedProductsQuery> requests, Class<T> clazz)Returns related products recommendations for a specific model and objectID.<T extends RecommendHit>
CompletableFuture<List<RecommendationsResult<T>>>getRelatedProductsAsync(List<RelatedProductsQuery> requests, Class<T> clazz, RequestOptions requestOptions)Returns related products recommendations for a specific model and objectID.HttpTransportgetTransport()Transport object responsible for the serialization/deserialization and the retry strategy.
-
-
-
Constructor Detail
-
RecommendClient
public RecommendClient(@Nonnull SearchConfig config, @Nonnull HttpRequester httpRequester)
-
-
Method Detail
-
close
public void close() throws IOExceptionClose the underlying Http Client- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an I/O error occurs
-
getTransport
public HttpTransport getTransport()
Transport object responsible for the serialization/deserialization and the retry strategy.
-
getConfig
public SearchConfig getConfig()
-
getRecommendations
public <T extends RecommendHit> List<RecommendationsResult<T>> getRecommendations(@Nonnull List<RecommendationsQuery> requests, @Nonnull Class<T> clazz)
Returns recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObject
-
getRecommendations
public <T extends RecommendHit> List<RecommendationsResult<T>> getRecommendations(@Nonnull List<RecommendationsQuery> requests, @Nonnull Class<T> clazz, RequestOptions requestOptions)
Returns recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObjectrequestOptions- options to pass to this request
-
getRecommendationsAsync
public <T extends RecommendHit> CompletableFuture<List<RecommendationsResult<T>>> getRecommendationsAsync(@Nonnull List<RecommendationsQuery> requests, @Nonnull Class<T> clazz)
Returns recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObject
-
getRecommendationsAsync
public <T extends RecommendHit> CompletableFuture<List<RecommendationsResult<T>>> getRecommendationsAsync(@Nonnull List<RecommendationsQuery> requests, @Nonnull Class<T> clazz, RequestOptions requestOptions)
Returns recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObjectrequestOptions- options to pass to this request
-
getRelatedProducts
public <T extends RecommendHit> List<RecommendationsResult<T>> getRelatedProducts(@Nonnull List<RelatedProductsQuery> requests, @Nonnull Class<T> clazz)
Returns related products recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObject
-
getRelatedProducts
public <T extends RecommendHit> List<RecommendationsResult<T>> getRelatedProducts(@Nonnull List<RelatedProductsQuery> requests, @Nonnull Class<T> clazz, RequestOptions requestOptions)
Returns related products recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObjectrequestOptions- options to pass to this request
-
getRelatedProductsAsync
public <T extends RecommendHit> CompletableFuture<List<RecommendationsResult<T>>> getRelatedProductsAsync(@Nonnull List<RelatedProductsQuery> requests, @Nonnull Class<T> clazz)
Returns related products recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObject
-
getRelatedProductsAsync
public <T extends RecommendHit> CompletableFuture<List<RecommendationsResult<T>>> getRelatedProductsAsync(@Nonnull List<RelatedProductsQuery> requests, @Nonnull Class<T> clazz, RequestOptions requestOptions)
Returns related products recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObjectrequestOptions- options to pass to this request
-
getFrequentlyBoughtTogether
public <T extends RecommendHit> List<RecommendationsResult<T>> getFrequentlyBoughtTogether(@Nonnull List<FrequentlyBoughtTogetherQuery> requests, @Nonnull Class<T> clazz)
Returns frequently bought together recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObject
-
getFrequentlyBoughtTogether
public <T extends RecommendHit> List<RecommendationsResult<T>> getFrequentlyBoughtTogether(@Nonnull List<FrequentlyBoughtTogetherQuery> requests, @Nonnull Class<T> clazz, RequestOptions requestOptions)
Returns frequently bought together recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObjectrequestOptions- options to pass to this request
-
getFrequentlyBoughtTogetherAsync
public <T extends RecommendHit> CompletableFuture<List<RecommendationsResult<T>>> getFrequentlyBoughtTogetherAsync(@Nonnull List<FrequentlyBoughtTogetherQuery> requests, @Nonnull Class<T> clazz)
Returns frequently bought together recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObject
-
getFrequentlyBoughtTogetherAsync
public <T extends RecommendHit> CompletableFuture<List<RecommendationsResult<T>>> getFrequentlyBoughtTogetherAsync(@Nonnull List<FrequentlyBoughtTogetherQuery> requests, @Nonnull Class<T> clazz, RequestOptions requestOptions)
Returns frequently bought together recommendations for a specific model and objectID.- Parameters:
requests- a list of recommendation requests to executeclazz- The class held by the index. Could be your business object orObjectrequestOptions- options to pass to this request
-
-