Guide
Smart Search
Configurations
14 min
if you haven't gone through the prerequisites and the v2 structure, please have a look at overview docid\ czeodl0skcuv 18ipuplr there are numerous settings, preferences, and configurations available with apiv2 to fine tune your search and category merchandising queries this section explores them in more detail sorting the default sorting of results is relevance, which uses klevu a i to determine the order there are various other options available which you can provide to your customers as required tab examples url https hostname cs v2 search name sort method post request pathparameters queryparameters headerparameters bodydataparameters kind optional name relevance type string description this is the default sort order which uses a combination of klevu a i and your own merchandising configuration to determine the order of the results kind optional name price asc type string description sort the results in ascending order by the saleprice value of each record kind optional name price desc type string description sort the results in descending order by the saleprice value of each record kind optional name name asc type string description sort the results in ascending by the name of each record in alphabetical order kind optional name name desc type string description sort the results in descending by the name of each record in alphabetical order kind optional name rating asc type string description sort the results in ascending by each record s average rating if this data has been indexed in your store kind optional name rating desc type string description sort the results in descending by each record s average rating if this data has been indexed in your store kind optional name new arrival asc type string description sort your records in ascending order based on their published date kind optional name new arrival desc type string description sort your records in descending order based on their published date formdataparameters results languages id 3xlvmt855lgkjoht0npxg code n meta n qtime 18 n responsecode 200 n n queryresults n n id productsearch n meta n qtime 17 n noofresults 12 n totalresultsfound 105 n typeofsearch wildcard and n offset 0 n debugginginformation n notificationcode 1 n searchedterm short n apikey klevu 156925593843210765 n ispersonalised false n n records n n score 0 19684093 n saleprice 24 00 n name aero daily fitness tee n id 31366478200894 n n n score 0 19684093 n saleprice 24 00 n name aero daily fitness tee n id 31366478364734 n n n score 0 19684093 n saleprice 24 00 n name aero daily fitness tee n id 31366478495806 n n n score 1 0985985 n saleprice 40 00 n name ana running short n id 31366431768638 n n n score 1 0985985 n saleprice 40 00 n name ana running short n id 31366431899710 n n n score 1 0985984 n saleprice 40 00 n name ana running short n id 31366431834174 n n n score 1 0985985 n saleprice 42 00 n name angel light running short n id 31366434062398 n n n score 1 0985985 n saleprice 42 00 n name angel light running short n id 31366433177662 n n n score 1 0985985 n saleprice 42 00 n name angel light running short n id 31366433996862 n n n score 1 0985929 n saleprice 32 50 n name apollo running short n id 31366465880126 n n n score 1 0985985 n saleprice 20 00 n name arcadio gym short n id 31366462668862 n n n score 1 0985985 n saleprice 20 00 n name arcadio gym short n id 31366462767166 n n n filters n n n language 200 customlabel selectedlanguageid 3xlvmt855lgkjoht0npxg examples languages id jsu7dlyyj euh63ysp682 code n recordqueries n n settings n sort name asc n query n term short n n fields n id n name n rating n saleprice n score n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n language json customlabel request body json id 8yg33te4jzfowp5yebmjh code ?php n n curl curl init ; n ncurl setopt array curl array n curlopt url https eucs15v2 ksearchnet com cs v2 search n curlopt returntransfer true n curlopt encoding n curlopt maxredirs 10 n curlopt timeout 0 n curlopt followlocation true n curlopt http version curl http version 1 1 n curlopt customrequest post n curlopt postfields n recordqueries n n settings n sort name asc n query n term short n n fields n id n name n rating n saleprice n score n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n n curlopt httpheader array n content type application json n n ; n n response curl exec curl ; n ncurl close curl ; necho response; n language php customlabel id wcdgtssqaxfiwklk2v174 code var data json stringify recordqueries settings sort name asc query term short fields id name rating saleprice score id productsearch context apikeys klevu 156925593843210765 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials false; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https eucs15v2 ksearchnet com cs v2 search ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript customlabel id npw0nije j5r9i5w4bgn0 code okhttpclient client new okhttpclient newbuilder n build ; nmediatype mediatype mediatype parse application json ; nrequestbody body requestbody create mediatype n recordqueries n n settings n sort name asc n query n term short n n fields n id n name n rating n saleprice n score n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n ; nrequest request new request builder n url https eucs15v2 ksearchnet com cs v2 search n method post body n addheader content type application json n build ; nresponse response client newcall request execute ; language java customlabel id 0ih7niekhhfml7cry51j code var request require request ; nvar options n method post n url https eucs15v2 ksearchnet com cs v2 search n headers n content type application json n n body json stringify recordqueries settings sort name asc query term short fields id name rating saleprice score id productsearch context apikeys klevu 156925593843210765 n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel selectedlanguageid wcdgtssqaxfiwklk2v174 description this is an example how to set record sorting order currentnewparameter label body parameter value bodydataparameters try it here! pagination you may wish to split larger result sets over multiple pages you can do this using pagination simply specify a page size for how many results each page should include, and an offset of which record to start each result set from tab examples url https hostname cs v2 search name pagination method post request pathparameters queryparameters headerparameters bodydataparameters kind optional name limit type integer description specify the number of records you would like to display per page if this field is not passed in the api the default value is 12 you can fetch a maximum of 100 records when you pass the limit in order to get more than 100 records you must define the fields in the api kind optional name offset type integer description specify the index at which to start counting the number of results from n nthe index of the first record in a result set is 0 thus if you want to start from the 6th result use an offset of 5 kind optional name typeofsearch type string description after the first has been retrieved for subsequent pagination requests it is recommended to include the typeofsearch value using the same value that came back in the meta data with the results of the first result this will give a performance benefit since klevu does not need to try different search types and will also assure consistency of results across pages formdataparameters results languages id 3xlvmt855lgkjoht0npxg code n meta n qtime 12 n responsecode 200 n n queryresults n n id productsearch n meta n qtime 11 n noofresults 5 n totalresultsfound 105 n typeofsearch wildcard and n offset 4 n debugginginformation n notificationcode 1 n searchedterm short n apikey klevu 156925593843210765 n ispersonalised false n n records n n name hawkeye yoga short n id 31366465060926 n n n name pierce gym short n id 31366462472254 n n n name hawkeye yoga short n id 31366465191998 n n n name hawkeye yoga short n id 31366465126462 n n n name pierce gym short n id 31366462439486 n n n filters n n n language 200 customlabel selectedlanguageid 3xlvmt855lgkjoht0npxg examples languages id jsu7dlyyj euh63ysp682 code n recordqueries n n settings n limit 5 n offset 4 n typeofsearch wildcard and n query n term short n n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n language json customlabel request body json id 8yg33te4jzfowp5yebmjh code ?php n n curl curl init ; n ncurl setopt array curl array n curlopt url https eucs15v2 ksearchnet com cs v2 search n curlopt returntransfer true n curlopt encoding n curlopt maxredirs 10 n curlopt timeout 0 n curlopt followlocation true n curlopt http version curl http version 1 1 n curlopt customrequest post n curlopt postfields n recordqueries n n settings n limit 5 n offset 4 n typeofsearch wildcard and n query n term short n n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n n curlopt httpheader array n content type application json n n ; n n response curl exec curl ; n ncurl close curl ; necho response; n language php customlabel id wcdgtssqaxfiwklk2v174 code var data json stringify recordqueries settings limit 5 offset 4 typeofsearch wildcard and query term short fields id name id productsearch context apikeys klevu 156925593843210765 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials false; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https eucs15v2 ksearchnet com cs v2 search ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript customlabel id npw0nije j5r9i5w4bgn0 code okhttpclient client new okhttpclient newbuilder n build ; nmediatype mediatype mediatype parse application json ; nrequestbody body requestbody create mediatype n recordqueries n n settings n limit 5 n offset 4 n typeofsearch wildcard and n query n term short n n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n ; nrequest request new request builder n url https eucs15v2 ksearchnet com cs v2 search n method post body n addheader content type application json n build ; nresponse response client newcall request execute ; language java customlabel id 0ih7niekhhfml7cry51j code var request require request ; nvar options n method post n url https eucs15v2 ksearchnet com cs v2 search n headers n content type application json n n body json stringify recordqueries settings limit 5 offset 4 typeofsearch wildcard and query term short fields id name id productsearch context apikeys klevu 156925593843210765 n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel selectedlanguageid wcdgtssqaxfiwklk2v174 description this is an example how to paginate records currentnewparameter label body parameter value bodydataparameters understanding response format params description noofresults the number of results requested to be returned for this query totalresultsfound the total number of results found for this query offset the index of the first result returned in this response typeofsearch the query type that was executed by klevu to retrieve the results try it here! fields by default, klevu will return most of the data available in a record if you only need certain elements and want to keep the response size small for performance reasons, you can specify only the fields you are interested in tab examples url https hostname cs v2 search name fields method post request pathparameters queryparameters headerparameters bodydataparameters kind optional name fields type array description an array of the attribute ids that you wish to retrieve eg id name saleprice etc please refer to searching for records to see all of the available fields formdataparameters results languages id 3xlvmt855lgkjoht0npxg code n meta n qtime 14 n responsecode 200 n n queryresults n n id productsearch n meta n qtime 12 n noofresults 12 n totalresultsfound 105 n typeofsearch wildcard and n offset 0 n debugginginformation n notificationcode 1 n searchedterm short n apikey klevu 156925593843210765 n ispersonalised false n n records n n saleprice 45 00 n name erika running short n id 31366431146046 n n n saleprice 45 00 n name erika running short n id 31366431080510 n n n saleprice 45 00 n name erika running short n id 31366431014974 n n n saleprice 32 50 n name meteor workout short n id 31366465781822 n n n saleprice 29 00 n name hawkeye yoga short n id 31366465060926 n n n saleprice 27 00 n name pierce gym short n id 31366462472254 n n n saleprice 29 00 n name hawkeye yoga short n id 31366465191998 n n n saleprice 29 00 n name hawkeye yoga short n id 31366465126462 n n n saleprice 27 00 n name pierce gym short n id 31366462439486 n n n saleprice 27 00 n name pierce gym short n id 31366462373950 n n n saleprice 32 00 n name sol active short n id 31366463094846 n n n saleprice 32 00 n name sol active short n id 31366463029310 n n n filters n n n language 200 customlabel selectedlanguageid 3xlvmt855lgkjoht0npxg examples languages id jsu7dlyyj euh63ysp682 code n recordqueries n n settings n fields n id n name n saleprice n n query n term short n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n language json customlabel request body json id 8yg33te4jzfowp5yebmjh code ?php n n curl curl init ; n ncurl setopt array curl array n curlopt url https eucs15v2 ksearchnet com cs v2 search n curlopt returntransfer true n curlopt encoding n curlopt maxredirs 10 n curlopt timeout 0 n curlopt followlocation true n curlopt http version curl http version 1 1 n curlopt customrequest post n curlopt postfields n recordqueries n n settings n fields n id n name n saleprice n n query n term short n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n n curlopt httpheader array n content type application json n n ; n n response curl exec curl ; n ncurl close curl ; necho response; n language php customlabel id wcdgtssqaxfiwklk2v174 code var data json stringify recordqueries settings fields id name saleprice query term short id productsearch context apikeys klevu 156925593843210765 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials false; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https eucs15v2 ksearchnet com cs v2 search ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript customlabel id npw0nije j5r9i5w4bgn0 code okhttpclient client new okhttpclient newbuilder n build ; nmediatype mediatype mediatype parse application json ; nrequestbody body requestbody create mediatype n recordqueries n n settings n fields n id n name n saleprice n n query n term short n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n ; nrequest request new request builder n url https eucs15v2 ksearchnet com cs v2 search n method post body n addheader content type application json n build ; nresponse response client newcall request execute ; language java customlabel id 0ih7niekhhfml7cry51j code var request require request ; nvar options n method post n url https eucs15v2 ksearchnet com cs v2 search n headers n content type application json n n body json stringify recordqueries settings fields id name saleprice query term short id productsearch context apikeys klevu 156925593843210765 n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel selectedlanguageid wcdgtssqaxfiwklk2v174 description this is an example how to limit fields attributes in search response currentnewparameter label body parameter value bodydataparameters try it here! grouping the groupby parameter takes the name of a field indexed in the klevu search backend and ensures that there is only one record for each unique value of this field in the search results by default, the groupby operation is performed on the itemgroupid field when querying for klevu category or klevu cms records, it is recommended to use name as the groupby parameter value tab examples url https hostname cs v2 search name grouping results method post request pathparameters queryparameters headerparameters bodydataparameters kind optional name groupby type string description the key of the attribute to group by for example name currently the only supported values are id and name formdataparameters results languages id 3xlvmt855lgkjoht0npxg code n meta n qtime 19 n responsecode 200 n n queryresults n n id productsearch n meta n qtime 17 n noofresults 12 n totalresultsfound 1 n typeofsearch wildcard and n offset 0 n debugginginformation n notificationcode 1 n searchedterm adrienne trek jacket n apikey klevu 156925593843210765 n ispersonalised false n n records n n name adrienne trek jacket n id 31366454378558 n n n filters n n n language 200 customlabel selectedlanguageid 3xlvmt855lgkjoht0npxg examples languages id jsu7dlyyj euh63ysp682 code n recordqueries n n settings n groupby name n query n term adrienne trek jacket n n sort name asc n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n language json customlabel request body json id 8yg33te4jzfowp5yebmjh code ?php n n curl curl init ; n ncurl setopt array curl array n curlopt url https eucs15v2 ksearchnet com cs v2 search n curlopt returntransfer true n curlopt encoding n curlopt maxredirs 10 n curlopt timeout 0 n curlopt followlocation true n curlopt http version curl http version 1 1 n curlopt customrequest post n curlopt postfields n recordqueries n n settings n groupby name n query n term adrienne trek jacket n n sort name asc n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n n curlopt httpheader array n content type application json n n ; n n response curl exec curl ; n ncurl close curl ; necho response; n language php customlabel id wcdgtssqaxfiwklk2v174 code var data json stringify recordqueries settings groupby name query term adrienne trek jacket sort name asc fields id name id productsearch context apikeys klevu 156925593843210765 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials false; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https eucs15v2 ksearchnet com cs v2 search ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript customlabel id npw0nije j5r9i5w4bgn0 code okhttpclient client new okhttpclient newbuilder n build ; nmediatype mediatype mediatype parse application json ; nrequestbody body requestbody create mediatype n recordqueries n n settings n groupby name n query n term adrienne trek jacket n n sort name asc n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n ; nrequest request new request builder n url https eucs15v2 ksearchnet com cs v2 search n method post body n addheader content type application json n build ; nresponse response client newcall request execute ; language java customlabel id 0ih7niekhhfml7cry51j code var request require request ; nvar options n method post n url https eucs15v2 ksearchnet com cs v2 search n headers n content type application json n n body json stringify recordqueries settings groupby name query term adrienne trek jacket sort name asc fields id name id productsearch context apikeys klevu 156925593843210765 n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel selectedlanguageid wcdgtssqaxfiwklk2v174 description this is an example how to group search results currentnewparameter label body parameter value bodydataparameters try it here! type of search the typeofsearch parameter defines the behaviour when identifying matches for a searched term for example, whether all or just one of the entered words must be matched, whether to allow spelling mistakes, etc tab examples url https hostname cs v2 search name type of search method post request pathparameters queryparameters headerparameters bodydataparameters kind optional name default type string description when this value is specified klevu will go through a number of attempts to find matching records the first type attempted is wildcard and if there aren t any results found klevu tries to find products with the fuzzy and query type n nas long as no matches are found klevu will continue to fire different query types in the following order nwildcard and nfuzzy and nwildcard or nfuzzy or nnote that when a search term only contains a single word or more than six words the or query types will be skipped kind optional name wildcard and type string description this is an and query so all words of the query must be found somewhere in a record for it to be included in the results the last word of the query will have a wildcard suffix appended n nfor example if the searched query is hooded jacket this will become hooded jacket ie klevu will try to find records containing the word hooded and any words beginning with jacket kind optional name fuzzy and type string description this is the same as a wildcard and query however a certain amount of fuzziness is allowed to account for spelling mistakes n nfor example if the searched query contains spelling mistakes like hooder jakcet klevu will still be able to match any records containing the words hooded and jacket kind optional name wildcard or type string description this is an or query so at least one of the words in the query must be found somewhere in a record for it to be included in the results the last word of the query will have a wildcard suffix appended n nfor example if the searched query is hooded jacket this will become hooded jacket ie klevu will try to find records containing the word hooded or any words beginning with jacket kind optional name fuzzy or type string description this is the same as a wildcard or query however a certain amount of fuzziness is allowed to account for spelling mistakes n nfor example if the searched query contains spelling mistakes like hooder jakcet klevu will still be able to match any records containing the words hooded or jacket kind optional name and type string description all of the exact words of a query must be found in a record for it to be included in the results no fuzziness or wildcards are included n nfor example a search for hooded jacket will only return records which contain the exact terms hooded and jacket kind optional name or type string description at least one exact word of a query must be found in a record for it to be included in a results no fuzziness or wildcards are included n nfor example a search for hooded jacket will only return records which contain one of the exact terms hooded or jacket formdataparameters results languages id 3xlvmt855lgkjoht0npxg code n meta n qtime 17 n responsecode 200 n n queryresults n n id productsearch n meta n qtime 16 n noofresults 12 n totalresultsfound 190 n typeofsearch fuzzy or n offset 0 n debugginginformation n notificationcode 1 n searchedterm short n apikey klevu 156925593843210765 n ispersonalised false n n records n n name rapha sports short n id 31366464503870 n n n name rapha sports short n id 31366464110654 n n n name rapha sports short n id 31366464667710 n n n name shorts n id category 156703227966 n n n name erika running short n id 31366431146046 n n n name erika running short n id 31366431014974 n n n name erika running short n id 31366431080510 n n n name meteor workout short n id 31366465781822 n n n name hawkeye yoga short n id 31366465126462 n n n name hawkeye yoga short n id 31366465191998 n n n name hawkeye yoga short n id 31366465060926 n n n name bess yoga short n id 31366434226238 n n n filters n n n language 200 customlabel selectedlanguageid 3xlvmt855lgkjoht0npxg examples languages id jsu7dlyyj euh63ysp682 code n recordqueries n n settings n typeofsearch fuzzy or n query n term short n n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n language json customlabel request body json id 8yg33te4jzfowp5yebmjh code ?php n n curl curl init ; n ncurl setopt array curl array n curlopt url https eucs15v2 ksearchnet com cs v2 search n curlopt returntransfer true n curlopt encoding n curlopt maxredirs 10 n curlopt timeout 0 n curlopt followlocation true n curlopt http version curl http version 1 1 n curlopt customrequest post n curlopt postfields n recordqueries n n settings n typeofsearch fuzzy or n query n term short n n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n n curlopt httpheader array n content type application json n n ; n n response curl exec curl ; n ncurl close curl ; necho response; n language php customlabel id wcdgtssqaxfiwklk2v174 code var data json stringify recordqueries settings typeofsearch fuzzy or query term short fields id name id productsearch context apikeys klevu 156925593843210765 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials false; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https eucs15v2 ksearchnet com cs v2 search ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript customlabel id npw0nije j5r9i5w4bgn0 code okhttpclient client new okhttpclient newbuilder n build ; nmediatype mediatype mediatype parse application json ; nrequestbody body requestbody create mediatype n recordqueries n n settings n typeofsearch fuzzy or n query n term short n n fields n id n name n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n ; nrequest request new request builder n url https eucs15v2 ksearchnet com cs v2 search n method post body n addheader content type application json n build ; nresponse response client newcall request execute ; language java customlabel id 0ih7niekhhfml7cry51j code var request require request ; nvar options n method post n url https eucs15v2 ksearchnet com cs v2 search n headers n content type application json n n body json stringify recordqueries settings typeofsearch fuzzy or query term short fields id name id productsearch context apikeys klevu 156925593843210765 n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel selectedlanguageid wcdgtssqaxfiwklk2v174 description this is an example how to change type of search results currentnewparameter label body parameter value bodydataparameters try it here! preferences there are a number of preferences available for fine tuning your queries for example, you can control whether or not to allow fuzzy search for spelling mistakes on a query by query basis the available searchprefs are detailed below tab examples url https hostname cs v2 search name search preferences method post request pathparameters queryparameters headerparameters bodydataparameters kind optional name showoutofstockproducts type string description whether or not your store should include out of stock products in search results by default can be configured within the klevu merchant centre however if you would like to override this for a particular query please include one of these flags kind optional name hideoutofstockproducts type string description flag to hide out of stock products n n kind optional name disablestocksorting type string description this can be used in conjunction with showoutofstockproducts if your store is configured to display out of stock products they will be displayed at the very end of the search results after all in stock products have been displayed by using this flag you can disable this logic and cause all products to be ranked in an order that disregards their stock status kind optional name includestopwords type string description by default functional words such as prepositions pronouns articles etc are excluded from searches add this flag to include these stopwords in your search kind optional name excludeids type string description use this flag to disable the searching of record ids kind optional name includedescription type string description whether or not a record s description is considered for search results can be configured by klevu support on a store by store basis however if you would like to override this for a particular query please include one of these flags kind optional name excludedescription type string description use this flag to exclude search in the description kind optional name disablefuzzymatch type string description this flag can be used in conjunction with the typeofsearch default to disable the fuzzy and and fuzzy or search types from being attempted kind optional name disablewildcard type string description this flag can be used in conjunction with the typeofsearch default to disable the wildcard and and wildcard or search types from being attempted kind optional name disableorsearch type string description this flag can be used in conjunction with the typeofsearch default to disable the wildcard or and fuzzy or search types from being attempted kind optional name partialmatch type string description enable partial match for the last word of a query where the last word searched can be a substring of any other word found in a record this can be useful for non english languages n nfor example let s say a product has the name r dvinsglas red wine glass if searching for h gt glas tall glass it may not match since the record has no words starting with glas by providing this flag the search would become h gt glas meaning it would match the record since it contains a word which ends with glas kind optional name partialmatchforallwords type string description similar to partialmatch but for all words rather than just the last in the same r dvinsglas example a search for h gt glas would become h gt glas so any records containing words containing h gt or glas would result in a match kind optional name disablewordshingles type string description for a query longer than one word all the possible bigrams and trigrams i e formed out of query terms are looked up in records and the ones having one or more of them are boosted higher up in the search results you can use this flag to disable such boosting kind optional name searchcompoundsasandquery type string description when a compound word is searched for i e two or more individual words joined together as one word klevu automatically disjoints them if the de compounding feature is enabled for your store n nfor example a search for fairylights would be treated as fairy lights but with the added condition that those words must appear within 5 words of each other in a matching record n nif you would prefer that the words fairy and light could be found anywhere within the record not necessarily near one another then please include this flag kind optional name enableboostingoriginaltermsinsynonyms type string description by default synonyms are treated equally to their query term should you wish to give higher priority to the actual terms your customer entered in the query over their synonyms please include this flag in your search preferences kind optional name showdisabledfacets type string description it is possible to configure which facets or filters should be enabled or disabled within the klevu merchant centre by including this flag all facets will be returned regardless of whether they have been disabled in the kmc kind optional name showfilterswithsmallcount type string description by default some filters are excluded from the results if they only have a small number of results please use this flag to override this logic and include all filters in the response kind optional name includecategoryfilterincatnav type string description when the typeofrequest is catnav the filter for category is automatically excluded since you are already within the context of a category use this flag to override this logic and return the category filters even for catnav requests kind optional name enablescores type string description include the score information with the response fields klevu product boosting and klevu manual boosting kind optional name disablegrouping type string description by default klevu groups results by itemgroupid use this flag to disable the grouping of products n formdataparameters results languages id 3xlvmt855lgkjoht0npxg code n meta n qtime 29 n responsecode 200 n n queryresults n n id productsearch n meta n qtime 26 n noofresults 12 n totalresultsfound 108 n typeofsearch wildcard and n offset 0 n debugginginformation n notificationcode 1 n searchedterm short n apikey klevu 156925593843210765 n ispersonalised false n n records n n discount n hidegroupprices n type shorts n itemgroupid 4384016203838 n score 1 7803618 n freeshipping n storebasecurrency gbp n price 45 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products wsh12 red main 9999e03f 694d 4f0c 83ab 8c0200029275 medium jpg?v 1575477719 n currency gbp n instock yes n id 31366431014974 n imagehover n sku wsh12 28 red n brand ksd n baseprice 45 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products wsh12 red main 9999e03f 694d 4f0c 83ab 8c0200029275 medium jpg?v 1575477719 n deliveryinfo n hideaddtocart n saleprice 45 0 n klevu product boosting 1 2 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products erika running short red n tags body hugging nylon red running short n size medium n name erika running short n shortdesc a great short with a body hugging design the erika running short is perfect for runners who prefer a fitted short rather than the traditional baggy variety seafoam pattern running shorts elastic waistband snug fit 4 n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384016269374 n score 1 7803618 n freeshipping n storebasecurrency gbp n price 45 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products wsh12 purple main c57ce41e 7b0e 4cd2 a0de 18ddb6d2017a medium jpg?v 1575477720 n currency gbp n instock yes n id 31366431080510 n imagehover n sku wsh12 28 purple n brand ksd n baseprice 45 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products wsh12 purple main c57ce41e 7b0e 4cd2 a0de 18ddb6d2017a medium jpg?v 1575477720 n deliveryinfo n hideaddtocart n saleprice 45 0 n klevu product boosting 1 2 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products erika running short purple n tags body hugging nylon red running short n size large n name erika running short n shortdesc a great short with a body hugging design the erika running short is perfect for runners who prefer a fitted short rather than the traditional baggy variety seafoam pattern running shorts elastic waistband snug fit 4 n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384016334910 n score 1 7803618 n freeshipping n storebasecurrency gbp n price 45 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products wsh12 green main 3ac6ebe5 2c3e 45cf 91cf ec54de5e5e3a medium jpg?v 1575477721 n currency gbp n instock yes n id 31366431146046 n imagehover n sku wsh12 28 green n brand ksd n baseprice 45 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products wsh12 green main 3ac6ebe5 2c3e 45cf 91cf ec54de5e5e3a medium jpg?v 1575477721 n deliveryinfo n hideaddtocart n saleprice 45 0 n klevu product boosting 1 2 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products erika running short green n tags body hugging green nylon running short n size small n name erika running short n shortdesc a great short with a body hugging design the erika running short is perfect for runners who prefer a fitted short rather than the traditional baggy variety seafoam pattern running shorts elastic waistband snug fit 4 n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384040386622 n score 1 513042 n freeshipping n storebasecurrency gbp n price 32 50 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh03 black main a8796b84 9c70 4146 9c73 2295b0d260a7 medium jpg?v 1575478122 n currency gbp n instock yes n id 31366465781822 n imagehover n sku msh03 32 black n brand kke n baseprice 32 5 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh03 black main a8796b84 9c70 4146 9c73 2295b0d260a7 medium jpg?v 1575478122 n deliveryinfo n hideaddtocart n saleprice 32 5 n klevu product boosting 1 02 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products meteor workout short black n tags black machine nylon relaxed fit short summer n size small n name meteor workout short n shortdesc step into the meteor workout short for an incredibly lightweight fitness experience its breathable construction and an inner brief provide additional comfort and support while the adjustable waistband offers the perfect fit to take you to the fi n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384039796798 n score 1 4835187 n freeshipping n storebasecurrency gbp n price 29 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh05 black main f61ee526 b9d3 4eaa b7b2 80dc400f31b0 medium jpg?v 1575478115 n currency gbp n instock yes n id 31366465191998 n imagehover n sku msh05 32 black n brand kke n baseprice 29 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh05 black main f61ee526 b9d3 4eaa b7b2 80dc400f31b0 medium jpg?v 1575478115 n deliveryinfo n hideaddtocart n saleprice 29 0 n klevu product boosting 1 0 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products hawkeye yoga short black n tags black machine motion friendly nylon relaxed fit smooth summer yoga short n size small n name hawkeye yoga short n shortdesc what more do you need than a sporty yoga short made with organic cotton and a little spandex for mobility? the hawkeye yoga short brings a stylish standard fit you can sport with confidence outside the studio dark gray shorts with red a n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384039665726 n score 1 4835187 n freeshipping n storebasecurrency gbp n price 29 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh05 gray main 0f869cff 09fb 403a a209 cf092f4d3c1a medium jpg?v 1575478112 n currency gbp n instock yes n id 31366465060926 n imagehover n sku msh05 32 gray n brand ksd n baseprice 29 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh05 gray main 0f869cff 09fb 403a a209 cf092f4d3c1a medium jpg?v 1575478112 n deliveryinfo n hideaddtocart n saleprice 29 0 n klevu product boosting 1 0 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products hawkeye yoga short gray n tags gray machine nylon relaxed fit short summer n size medium n name hawkeye yoga short n shortdesc what more do you need than a sporty yoga short made with organic cotton and a little spandex for mobility? the hawkeye yoga short brings a stylish standard fit you can sport with confidence outside the studio dark gray shorts with red a n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384039731262 n score 1 4835187 n freeshipping n storebasecurrency gbp n price 29 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh05 blue main 2130114d 06b0 4793 8fc2 bf77411297e4 medium jpg?v 1575478114 n currency gbp n instock yes n id 31366465126462 n imagehover n sku msh05 32 blue n brand mnh n baseprice 29 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh05 blue main 2130114d 06b0 4793 8fc2 bf77411297e4 medium jpg?v 1575478114 n deliveryinfo n hideaddtocart n saleprice 29 0 n klevu product boosting 1 0 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products hawkeye yoga short blue n tags blue machine nylon relaxed fit short summer n size large n name hawkeye yoga short n shortdesc what more do you need than a sporty yoga short made with organic cotton and a little spandex for mobility? the hawkeye yoga short brings a stylish standard fit you can sport with confidence outside the studio dark gray shorts with red a n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384037765182 n score 1 4835187 n freeshipping n storebasecurrency gbp n price 27 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh12 gray main 4bb28c53 a928 47a0 92ea ecd303f97dba medium jpg?v 1575478089 n currency gbp n instock yes n id 31366462439486 n imagehover n sku msh12 32 gray n brand mnh n baseprice 27 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh12 gray main 4bb28c53 a928 47a0 92ea ecd303f97dba medium jpg?v 1575478089 n deliveryinfo n hideaddtocart n saleprice 27 0 n klevu product boosting 1 0 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products pierce gym short gray n tags gray machine nylon relaxed fit short summer n size large n name pierce gym short n shortdesc the pierce gym short is similar to our arcadio gym short but designed with a fitted tapered look a flat waistband with an adjustable drawstring adds comfort with zippered pockets for safe easy storage dark red cotton shorts 8 n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384037830718 n score 1 4835187 n freeshipping n storebasecurrency gbp n price 27 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh12 black main 2ef78733 04a5 4345 9f5f 992d0cfffe8d medium jpg?v 1575478090 n currency gbp n instock yes n id 31366462472254 n imagehover n sku msh12 32 black n brand kke n baseprice 27 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh12 black main 2ef78733 04a5 4345 9f5f 992d0cfffe8d medium jpg?v 1575478090 n deliveryinfo n hideaddtocart n saleprice 27 0 n klevu product boosting 1 0 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products pierce gym short black n tags black machine nylon relaxed fit short summer n size small n name pierce gym short n shortdesc the pierce gym short is similar to our arcadio gym short but designed with a fitted tapered look a flat waistband with an adjustable drawstring adds comfort with zippered pockets for safe easy storage dark red cotton shorts 8 n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384037699646 n score 1 4835186 n freeshipping n storebasecurrency gbp n price 27 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh12 red main 6c29f610 d5f7 4e1a bde4 1fb148964be5 medium jpg?v 1575478088 n currency gbp n instock yes n id 31366462373950 n imagehover n sku msh12 32 red n brand ksd n baseprice 27 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh12 red main 6c29f610 d5f7 4e1a bde4 1fb148964be5 medium jpg?v 1575478088 n deliveryinfo n hideaddtocart n saleprice 27 0 n klevu product boosting 1 0 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products pierce gym short red n tags cotton machine relaxed fit res short summer n size medium n name pierce gym short n shortdesc the pierce gym short is similar to our arcadio gym short but designed with a fitted tapered look a flat waistband with an adjustable drawstring adds comfort with zippered pockets for safe easy storage dark red cotton shorts 8 n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384038256702 n score 1 4835119 n freeshipping n storebasecurrency gbp n price 32 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh10 green main 18d664f2 5ba2 421d b89a 87cb73d86416 medium jpg?v 1575478095 n currency gbp n instock yes n id 31366463029310 n imagehover n sku msh10 32 green n brand mnh n baseprice 32 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh10 green main 18d664f2 5ba2 421d b89a 87cb73d86416 medium jpg?v 1575478095 n deliveryinfo n hideaddtocart n saleprice 32 0 n klevu product boosting 1 0 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products sol active short green n tags green machine nylon relaxed fit short summer n size large n name sol active short n shortdesc you ll let your fear go and push your limits in your new sol active short featuring ultra breathable performance fabric and a flat comfort fit waistband the sol active short is perfect for high intensity circuits or high heat bikram li n klevu manual boosting 1 0 n category shorts n n n discount n hidegroupprices n type shorts n itemgroupid 4384038158398 n score 1 4835119 n freeshipping n storebasecurrency gbp n price 32 00 n toprice n imageurl https cdn shopify com s files 1 0116 9457 1582 products msh10 purple main 1e2fd886 6ce1 4258 8fe5 6ca863ab5f9e medium jpg?v 1575478094 n currency gbp n instock yes n id 31366462931006 n imagehover n sku msh10 32 purple n brand ksd n baseprice 32 0 n startprice n image https cdn shopify com s files 1 0116 9457 1582 products msh10 purple main 1e2fd886 6ce1 4258 8fe5 6ca863ab5f9e medium jpg?v 1575478094 n deliveryinfo n hideaddtocart n saleprice 32 0 n klevu product boosting 1 0 n swatchesinfo n weight n klevu category klevu product;products;;shorts ku kucategory ku n totalvariants 0 n groupprices n url https jsv2 shopify demo ksearchmisc com products sol active short purple n tags black machine nylon relaxed fit short summer n size medium n name sol active short n shortdesc you ll let your fear go and push your limits in your new sol active short featuring ultra breathable performance fabric and a flat comfort fit waistband the sol active short is perfect for high intensity circuits or high heat bikram li n klevu manual boosting 1 0 n category shorts n n n filters n n n language 200 customlabel selectedlanguageid 3xlvmt855lgkjoht0npxg examples languages id jsu7dlyyj euh63ysp682 code n recordqueries n n settings n searchprefs n showoutofstockproducts n disablestocksorting n includestopwords n excludeids n includedescription n disablefuzzymatch n disablewildcard n disableorsearch n partialmatch n partialmatchforallwords n disablewordshingles n searchcompoundsasandquery n enableboostingoriginaltermsinsynonyms n showdisabledfacets n showfilterswithsmallcount n includecategoryfilterincatnav n enablescores n disablegrouping n n query n term short n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n language json customlabel request body json id 8yg33te4jzfowp5yebmjh code ?php n n curl curl init ; n ncurl setopt array curl array n curlopt url https eucs15v2 ksearchnet com cs v2 search n curlopt returntransfer true n curlopt encoding n curlopt maxredirs 10 n curlopt timeout 0 n curlopt followlocation true n curlopt http version curl http version 1 1 n curlopt customrequest post n curlopt postfields n recordqueries n n settings n searchprefs n showoutofstockproducts n disablestocksorting n includestopwords n excludeids n includedescription n disablefuzzymatch n disablewildcard n disableorsearch n partialmatch n partialmatchforallwords n disablewordshingles n searchcompoundsasandquery n enableboostingoriginaltermsinsynonyms n showdisabledfacets n showfilterswithsmallcount n includecategoryfilterincatnav n enablescores n debugquery n disablegrouping n n query n term short n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n n curlopt httpheader array n content type application json n n ; n n response curl exec curl ; n ncurl close curl ; necho response; n language php customlabel id wcdgtssqaxfiwklk2v174 code var data json stringify recordqueries settings searchprefs showoutofstockproducts disablestocksorting includestopwords excludeids includedescription disablefuzzymatch disablewildcard disableorsearch partialmatch partialmatchforallwords disablewordshingles searchcompoundsasandquery enableboostingoriginaltermsinsynonyms showdisabledfacets showfilterswithsmallcount includecategoryfilterincatnav enablescores debugquery disablegrouping query term short id productsearch context apikeys klevu 156925593843210765 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials false; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https eucs15v2 ksearchnet com cs v2 search ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript customlabel id npw0nije j5r9i5w4bgn0 code okhttpclient client new okhttpclient newbuilder n build ; nmediatype mediatype mediatype parse application json ; nrequestbody body requestbody create mediatype n recordqueries n n settings n searchprefs n showoutofstockproducts n disablestocksorting n includestopwords n excludeids n includedescription n disablefuzzymatch n disablewildcard n disableorsearch n partialmatch n partialmatchforallwords n disablewordshingles n searchcompoundsasandquery n enableboostingoriginaltermsinsynonyms n showdisabledfacets n showfilterswithsmallcount n includecategoryfilterincatnav n enablescores n debugquery n disablegrouping n n query n term short n n n id productsearch n n n context n apikeys n klevu 156925593843210765 n n n ; nrequest request new request builder n url https eucs15v2 ksearchnet com cs v2 search n method post body n addheader content type application json n build ; nresponse response client newcall request execute ; language java customlabel id 0ih7niekhhfml7cry51j code var request require request ; nvar options n method post n url https eucs15v2 ksearchnet com cs v2 search n headers n content type application json n n body json stringify recordqueries settings searchprefs showoutofstockproducts disablestocksorting includestopwords excludeids includedescription disablefuzzymatch disablewildcard disableorsearch partialmatch partialmatchforallwords disablewordshingles searchcompoundsasandquery enableboostingoriginaltermsinsynonyms showdisabledfacets showfilterswithsmallcount includecategoryfilterincatnav enablescores debugquery disablegrouping query term short id productsearch context apikeys klevu 156925593843210765 n n ; nrequest options function error response n if error throw new error error ; n console log response body ; n ; n language nodejs customlabel selectedlanguageid wcdgtssqaxfiwklk2v174 description this is an example how to use different search preferences currentnewparameter label body parameter value bodydataparameters try it here!