getSearchResultsCRT
suspend fun getSearchResultsCRT( term: String, facets: List<Pair<String, List<String>>>? = null, page: Int? = null, perPage: Int? = null, groupId: Int? = null, sortBy: String? = null, sortOrder: String? = null, sectionName: String? = null, hiddenFields: List<String>? = null, hiddenFacets: List<String>? = null, groupsSortBy: String? = null, groupsSortOrder: String? = null, variationsMap: VariationsMap? = null, preFilterExpression: String? = null, fmtOptions: Map<String, Any>? = null): SearchResponse
Content copied to clipboard
Returns a list of search results including filters, categories, sort options, etc. This function should be called within a coroutine scope.
Example:
runBlocking {
launch {
try {
val searchResults = constructorIo.getSearchResultsCRT("Dav")
// Do something with searchResults
} catch (e: Exception) {
println(e)
}
}
}
Content copied to clipboard
Parameters
term
the term to search for
facets
additional facets used to refine results
page
the page number of the results
perPage
The number of results per page to return
groupId
category facet used to refine results
sortBy
the sort method for results
sortOrder
the sort order for results
sectionName
the section the results will come from defaults to "Products"
hiddenFields
show fields that are hidden by default
hiddenFacets
show facets that are hidden by default
groupsSortBy
the sort method for groups
groupsSortOrder
the sort order for groups
variationsMap
specify which attributes within variations should be returned
preFilterExpression
faceting expression to scope results
fmtOptions
additional format options to pass