Group search results

Jan Willem Bergsma asked on October 20, 2016 14:21

Hi,

I'm using the webpart SmartSearchResults. Is it possible, with this webpart (or other), to group the search results by page type or search index? I have created serveral indexes.

Or should I implement multiple webparts? Each with it's own index.

Thanks in advance

Regards Jan Willem

Recent Answers


Roman Hutnyk answered on October 20, 2016 15:47

I'm not aware of grouping capabilities, but you could try to sort them by page type, so the pages of the same type will go together. You can also use another fields in sort expression, so pages will be sorted by type and name for example.

0 votesVote for this answer Mark as a Correct answer

Peter M answered on October 20, 2016 16:06 (last edited on October 20, 2016 16:06)

Not quite sure what you mean by grouping. You can probably use smart search results in conjunction with ht smart search filter web part. In my case I use smart search filter to show documents by categories, but you can filter by any property in your index. So if your indexes have several page types, you can filter by page types. https://docs.kentico.com/display/K8/Using+search+filters

0 votesVote for this answer Mark as a Correct answer

Jan Willem Bergsma answered on October 20, 2016 19:33

Hi Roman, Peter,

For information. I use Kentico 9. I want to look the search results like this:

Cateory A:

Link1

Link2

Link 3

More results

Category B Link a

Link b

Link c

More results

etc, etc etc

Is this possible?

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on October 20, 2016 19:35

This is possible with custom control. Use smart search API to achieve this.

0 votesVote for this answer Mark as a Correct answer

Peter M answered on October 21, 2016 20:57 (last edited on October 21, 2016 21:08)

Sure it is possible, but it depends on your set-up. For ex.: You can create a custom field "mysearchsort" make it "indexible" for your page types. Order smart search results by "mysearchsort".

If is a good practice to use luke (lucene index tool box) - to see what is inside your index. You might want to use fields which already exists, instead of creating your own.

In transformation when you render search results you can save mysearchsort in RequestStockObject. On each iteration you check it and if your current mysearchsort is different from the one you saved in RequestStockObject you render you category title "Category X:"

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.