This site is now out of date, and currently exists here as an archive only.

Mentor Web Blocks is still under development.

Please click here to view the latest version.

Examine and Mentor Web Blocks

Many of you may be wondering, how do I search the wysiwyg content that users input into the page wysiwyg block?  This tutorial will show you how Mentor Web Blocks works with Umbraco Examine and how to build a simple search.

When Umbraco Examine is gathering node data to index, we index the wysiwyg content for each container that can be accessed through a unique field id.

The format for these field ids are:

WBContainer_ + container name

This is the field name to get access to the Wysiwyg content in a specific container.

In the Mentor Web Blocks Runway Website you will reference WBContainer_contentContainer

Tip: Always name your content container the same on all templates so your wysiwyg content can migrate from one template to another

WBWysiwyg This is all the wysiwyg aggregated into one long wysiwyg text.  This may be easier to search against.

 

Here is a snippet you can use to begin your search:

IBooleanOperation boolSearch searchProvider.CreateSearchCriteria()
   .GroupedOr(new string["nodeName""WBContainer_contentContainer" }
     Examine.LuceneEngine.SearchCriteria.LuceneSearchExtensions.MultipleCharacterWildcard(terms[0]));

 

ISearchCriteria searchCriteria boolSearch.Compile();


var searchResults searchProvider.Search(searchCriteria);

 

Hope that helps you kick start your search development with Mentor Web Blocks.  

If you would like to contribute to this tutorial, please contact webblocks@mentordigital.co.uk

Share this page:
Subscribe: