Search result order by document type

Mateusz Żebrowski asked on April 9, 2015 14:08

I'm using Kentico 7.

Is it possible to display certain document type (i.e. products) on the top in search results?

Correct Answer

Dawid Jachnik answered on April 9, 2015 14:47

Hello Mateusz,

yes, it is possible in two ways.

  1. Create two indexes and the results web parts and order them in design mode. That the first one will be displaying just products and the second one other pages. But it doesn't work good with paging.

  2. Is you are using smart search, you can boost query by document type. Just put the additional condition in smart search results webpart: +(classname:cms.products)^2

Important thing is that the ClassName fields should be only searchable and tokenized option enabled in search fields of your page type. You can find this search fields in ecommerce.sku class in Ecommerce module.

More details about the boosting http://lucene.apache.org/core/3_5_0/queryparsersyntax.html#BoostingaTerm

2 votesVote for this answer Unmark Correct answer

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