Build UI
Modify Request

Examples

6min
modify request below are some common uses of modifying the query request you can find guides for more elaborate customizations within the how to section of the template js documentation please review the modify request overview docid ndrepmgauhyltilxkg o for complete details on the syntax used for modifying the outgoing query facet/filter options count increase the default maximum number of filter options (10) to "20" for every query klevu modifyrequest("all", function (data, scope) { klevu each(data request current recordqueries, function (key, query) { klevu setobjectpath(query, "filters filterstoreturn options limit", 20); }) }); api parameter description options limit specify the maximum number of options to be included per filter see klevu api documentation on retrieving filters for more details and options run time boosting influence the relevancy algorithm by assigning weight to different aspects at the time of query klevu modifyrequest("landing","productlist", { "boost" { "filters" \[ { "key" "brand", "values" \["acme"], "weight" 200 } ] } }); api parameter description boost query level aspects to influence the relevancy rankings see klevu api personalisation docid\ yfu114puw2ltvf05gafwv for more details and more options constrain result set (advanced filtering) you can add a groupcondition to restrict the result set to specific attributes and values this constraint is typically applied "behind the scenes" to create specialized result set experiences some examples include brand specific listings curated landing pages automotive fitment klevu modifyrequest("landing","productlist", { "settings" { "groupcondition" { "groupoperator" "all of", "conditions" \[ { "key" "brand", "valueoperator" "include", "values" \[ "acme" ] } ] } } }); api parameter description groupoperator defines the condition of filtering ( all of , any of , none of ) conditions the array of attributes ( key ) to apply to the condition see klevu api advance filtering docid\ rbt4zzdiheip1lcuk8n r for more details and more options