[bug]: unable to get recommendations #796
Copy link
Copy link
Closed
Description
Description
Using the RecommendClient and getting a result back, i get a list of records of inner-private class RecommendedHitWrapper
Line 29 in 80aa7dd
| this.value = value; |
I do not see any way to convert this or get at the value, that is a RecommendHit.
Can someone clue me how i'm supposed to do this in v 4?
Client
Recommend
Version
4.22
Relevant log output
Class cast exceptionReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
millotp commentedon Sep 5, 2025
Hey @asgerjensen,
you can use
getValue()defined just below:algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendationsHit.java
Line 32 in 80aa7dd
asgerjensen commentedon Sep 5, 2025
Yees, but thats an inner class. The type returned is a RecommendationsHit.
Even if i then rely on the inner class, it doesn't really read that nice.
Is this the expected use?
Seems i should be able to skip the wrapper somehow.. @millotp
millotp commentedon Oct 8, 2025
Would it help to have helper methods like
hit.asRecommendHit()orhit.asTrendingFacetHit()for example ?