getRecommendationResults

fun getRecommendationResults(    podId: String,     facets: List<Pair<String, List<String>>>? = null,     numResults: Int? = null,     sectionName: String? = null,     itemId: String? = null,     term: String? = null,     variationsMap: VariationsMap? = null,     preFilterExpression: String? = null,     hiddenFields: List<String>? = null): Observable<ConstructorData<RecommendationsResponse>>

Returns a list of recommendation results for the specified pod.

Example:

ConstructorIo.getRecommendationResults(podId, selectedFacets?.map { it.key to it.value }, numResults)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
it.onValue {
it.response?.let {
view.renderData(it)
}
}
}

Parameters

podId

the pod id

facets

additional facets used to refine results

numResults

the number of results to return

sectionName

the section the selection will come from, i.e. "Products"

itemId

: The item id to retrieve recommendations (strategy specific)

term

: The term to use to refine results (strategy specific)

variationsMap

specify which attributes within variations should be returned

preFilterExpression

faceting expression to scope results

hiddenFields

show fields that are hidden by default


fun getRecommendationResults(request: RecommendationsRequest): Observable<ConstructorData<RecommendationsResponse>>

Returns a list of recommendation results for the specified pod.

Example:

val request = RecommendationsRequest.Builder("product_detail_page")
.setItemIds(listOf("item_id_123"))
.build()

ConstructorIo.getRecommendationResults(request)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
it.onValue {
it?.let {
view.renderData(it)
}
}
}

Parameters

podId

the pod id

filters

additional filters used to refine results

itemIds

the list of item ids to retrieve recommendations for (strategy specific)

term

the term to use to refine results (strategy specific)

numResults

the number of results to return

section

the section the results will come from, i.e. "Products"

variationsMap

specify which attributes within variations should be returned

preFilterExpression

faceting expression to scope results