get Search Results
Returns a list of search results including filters, categories, sort options, etc.
Example:
ConstructorIo.getSearchResults("Dave's bread", selectedFacets?.map { it.key to it.value }, 1, 24)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe {
it.onValue {
it.response?.let {
view.renderData(it)
}
}
}
Parameters
the term to search for
additional facets used to refine results
the page number of the results
The number of results per page to return
category facet used to refine results
the sort method for results
the sort order for results
the section the results will come from defaults to "Products"
show fields that are hidden by default
show facets that are hidden by default
the sort method for groups
the sort order for groups
specify which attributes within variations should be returned
faceting expression to scope results
additional format options to pass
Returns a list of search results including filters, categories, sort options, etc. utilizing a request object.
Example:
val filters = mapOf(
"group_id" to listOf("G1234"),
"Brand" to listOf("Cnstrc")
"Color" to listOf("Red", "Blue")
)
val request = SearchRequest.Builder("Dav")
.setFilters(filters)
.setHiddenFacets(listOf("hidden_facet_1", "hidden_facet_2"))
.build()
ConstructorIo.getSearchResults(request)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
it.onValue {
it?.let {
view.renderData(it)
}
}
}
Parameters
the search request object