Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I've built a mashup with a custom search function using Capability API. I'm using the searchResults and selectAssociations methods. My mashup works perfectly fine with 8 - 10 search items.
However, when I select 11 or more items, for example 11 stores (store 1, store 2, ...., store 11), the selection doesn't work. The error that I receive in Chrome dev console is this:
code: 15000, parameter: "Search query took to long", message: "Search timeout".
It seems that selectAssociations has a search limit.
Is there something I can do to optimize the response time or to bypass the limit, if the limit exists?
Hi @gabineaq,
This is a known issue, the smart search team have been contacted and will deal with by either documenting a limitation or fix it.
A possible workaround will be to split the array of search terms in 2 or more arrays then chain the selectAssociations calls
const searchTermsPart1 = ['store1','store2','store3','store4']; const searchTermsPart2 = ['store5','store6','store7','store8']; app.selectAssociations( 0, searchTermsPart1 ).then(()=>{ app.selectAssociations( 0, searchTermsPart2 ); }); // nicer if used with async await
I hope this helps,
Hi @gabineaq,
This is a known issue, the smart search team have been contacted and will deal with by either documenting a limitation or fix it.
A possible workaround will be to split the array of search terms in 2 or more arrays then chain the selectAssociations calls
const searchTermsPart1 = ['store1','store2','store3','store4']; const searchTermsPart2 = ['store5','store6','store7','store8']; app.selectAssociations( 0, searchTermsPart1 ).then(()=>{ app.selectAssociations( 0, searchTermsPart2 ); }); // nicer if used with async await
I hope this helps,
Hi @Aiham_Azmeh,
Thanks for the reply. It's really useful.
I'll try to chain the selectAssociations calls and check how the search performs.