November Happy Hour will be moved to Thursday December 5th.

Search results return only pages

Vote:
 

I have search implemented on my 7.5 site. It works except that it returns anything with the search terms - pages and blocks. I need it to only return pages. How can I set that up to return pages that either have search terms in their direct content or any blocks on that page?

Thanks!

#133324
Sep 01, 2015 17:22
Vote:
 

Hi, Nathan,

Are you using built-in search and the implementation from AlloyTech templates?

If so, built-in search searches the content types you set in QueryExpressions for Lucene and under search roots you specify. However, even if you do this, you will get into trouble with multiple pages (if you have a page and a block on it with the same keyword, you would get the page twice in the search results).

So, the best approach we have been using so far is Jeroen's https://jstemerdink.wordpress.com/2014/10/11/indexing-blocks-with-episerver-search-revisited/. In his first, you can read more about the approach, too: https://jstemerdink.wordpress.com/2014/04/05/indexing-blocks-with-episerver-search/

In brief, the blocks aren't searched for, their searchable content is saved to the belonging page(s).

Hope that helps,

Marija

#133337
Sep 02, 2015 9:03
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.