Separate search result by collection
Hi Low,
I just purchased Low Search and i'd like to know if we're able to separate results by collection, for e.g, i have these collection Sport Shoe, High heels, Ballet shoe and Leather shoe. And I want the results to be displayed as follow when the user search for 'red colour'.
Sport Shoes (2 results)
-----------------------------------
1. Result item 1
1. Result item 2
High heels (1 result)
-----------------------------------
1. Result item 1
Ballet Shoes ( 4 results)
-----------------------------------
1. etc...
etc...
Replies
Low 21 May 2012 09:08
Currently, that's only possible if you add a low_search:results tag for each collection. However, that could cause some performance issues, 'cause each query will be executed for each tag.
But let me ask this first: how are you handling pagination with a setup like this? Or are you not paginating search results?
TheJae 21 May 2012 09:11
I am not paginating.
It's just a design thing, if it's not really recommended then i'll just output a list. I was hoping I could wrap the results as follow:
{low_search_collection_sportshoes}
{entryid} - {title} ({entry_date})
{/low_search_collection_sportshoes}
Low 21 May 2012 09:19
I'm afraid that's not possible at the moment. But you could get the desired output by using PHP on Output in your template. Something like this: