Learn how to create customized search results that leverage DNN's lucene index data. I want to take the next step of showing developers how to create custom search results that can query the lucene data in very specific ways to present the results exactly the way you, or your client, needs them. This is part 2 of 3.
Learn how to create customized search results that leverage DNN's lucene index data. At last year's DNNCon, Ash Prasad presented a great session about the newly redesigned search engine in DNN 7.1 and above. He discussed the search architecture, lucene concepts, and the new ModuleSearchBase class for allowing developers to inject data into the index. This year, I want to take the next step of showing developers how to create custom search results that can query the lucene data in very specific ways to present the results exactly the way you, or your client, needs them.
Custom Search Results Module
- Login as Host
- Create a page
- On the admin ribbon, select Modules > Create Module
- Drop an instance of the Module Creator module onto the page
- Enter the following settings:
- Owner Name: DotNetNuclear
- Module Name: CustomSearch
- Language: C#
- Template: Module - User Control
- Control Name: View
- You should now have a working and registered module in the /DesktopModules/DotNetNuclear/CustomSearch folder. Replace the files in this folder with the ones in the DotNetNuclear_HandlebarsCustomResults.zip file.
Client-centric Module w/ Search
This module shows off several techniques: knockout/WebAPI front end, ModuleSearchBase implementation, and Lucene search. Follow the instructions to install:
- Download the DotNetNuclear.SearchContent.zip file
- Unzip the project folder (DotNetNuclear.SearchContent) under the \DesktopModules folder
- Open Visual Studio 2012 or 2013 as an Administrator and open the project
- Build project in Release mode
- Install the \install\*_Install package in Host > Extensions
- Create a test page and drop an instance of the module on the page
Prerequisite Training for this session
This is a more advanced topic in module development. Some topics like WebAPI services development, Knockoutjs, ModuleSearchBase, in addition to basic module development are assumed when reviewing this material. If you are not familiar with some of these topics, no problem! I have lots of training videos here and on DNNHero.com to get you up to speed.
Essential DNN Module Development
WebAPI Services and Knockoutjs