ModuleSearchBase

Return to previous page

  • 4/7/2015
  • 2647 Views

Comments

2647 Views

ModuleSearchBase

Last updated 1 year ago

Comments

Common

(Enter the content of this article below)

Advanced

 

In order to integrate the content in your custom module with DNN's search index, inherit from the ModuleSearchBase abstract base class in the Business Controller Class for your module.
Example from the HTMLText module

public class HtmlTextController : ModuleSearchBase, IPortable, IUpgradeable
...

Implement (just one) method: GetModifiedSearchDocuments, to return a list of SearchDocuments. This implementation only has to deal with content modified since the last call to GetModifiedSearchDocuments. So an incremental search has to be implemented.

Example (from the HTMLText module), where the beginTime is the start of the added, modified or deleted content

public override IList<SearchDocument> GetModifiedSearchDocuments(ModuleInfo modInfo, DateTime beginDate)
{
    ...
    var searchDocuments = new List<SearchDocument>();
    ...
    searchDocuments.Add(searchDoc);
    ....
    return searchDocuments;
}

In the manifest file for the module, you must provide “Searchable” as one of the SupportedFeatures. Example:

<supportedFeatures>
    <supportedFeature type="Portable" />
    <supportedFeature type="Searchable" />
    <supportedFeature type="Upgradeable" />
</supportedFeatures>
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out