get Autocomplete Results
fun getAutocompleteResults( term: String, facets: List<Pair<String, List<String>>>? = null, groupId: Int? = null, hiddenFields: List<String>? = null, variationsMap: VariationsMap? = null, sectionFacets: Map<String, List<Pair<String, List<String>>>>? = null): Observable<ConstructorData<AutocompleteResponse>>
Content copied to clipboard
Returns a list of autocomplete suggestions.
Example:
ConstructorIo.getAutocompleteResults("Dav", selectedFacet?.map { it.key to it.value })
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
it.onValue {
it?.let {
view.renderData(it)
}
}
}
Content copied to clipboard
Parameters
term
the term to search for
facets
additional facets used to refine results
group Id
category facet used to refine results
hidden Fields
show fields that are hidden by default
variations Map
specify which attributes within variations should be returned
section Facets
specify sections for additional facets used to refine results
fun getAutocompleteResults(request: AutocompleteRequest): Observable<ConstructorData<AutocompleteResponse>>
Content copied to clipboard
Returns a list of autocomplete suggestions utilizing a request object.
Example
val filters = mapOf(
"group_id" to listOf("G1234"),
"Brand" to listOf("Cnstrc")
"Color" to listOf("Red", "Blue")
)
val request = AutocompleteRequest.Builder("Dav")
.setFilters(filters)
.setHiddenFields(listOf("hidden_field_1", "hidden_field_2"))
.build()
ConstructorIo.getAutocompleteResults(request)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
it.onValue {
it?.let {
view.renderData(it)
}
}
}
Content copied to clipboard
Parameters
request
the autocomplete request object