DNN search integration

Search results customization

There are 4 settings you can addto the manifest.json specific for DNN search :

  • dnnSearch,
  • dnnSearchTitle,
  • dnnSearchDescription,
  • dnnSearchText
  • dnnSearchUrl

You add these to the "Main" template.

dnnSearch

By default Open Content is not indexed in DNN.
To activate indexing, set dnnSearch to true in the manifest

dnnSearchTitle

With this attribute you can set what Text will be passed to DNN search crawler as the Title.

dnnSearchDescription

With this attribute you can set what Text will be passed to DNN search crawler as the Description.

dnnSearchText

With this attribute you can set what Text will be passed to DNN search crawler as the Main Text.

dnnSearchUrl

This field can be used to point a search result to a manipulated or external URL. The use case for this addition was to show data from an external website in the DNN Search results using Open Content.

{    
    "templates": {
        "list": {
            "type": "multiple",
            "title": "List",            
            "main": {
                "template": "list.hbs",
                 "dnnsearch": true,
                 "dnnSearchTitle": "{{Title}}",
                 "dnnSearchDescription": "Article: {{Summary}}",
                 "dnnSearchText": "{{Text}}"
            },
            "detail": {
              "template": "detail.hbs",
            }
        }
    }
}

Also see Manifest for exact usage and examples.

How to debug not indexed content

Modify DotNetNuke.log4net.config
set

<level value="Trace"/>

Then investigate the dnn log files.

Single item templates

For single item templates that contain field types of type "array", you need to contruct the search text just like you would do in an handlebars template.
E.g.
"dnnSearchText": "{{Introduction}} {{#each Columns}} {{Title}} {{Description}} {{/each}}"
In this example you have a text field "Introduction" and a array field "Columns" that contains two fields "Title" and "Description".

Updating an existing template to activate DNN search

When you start out with a template without a manifest, and you add a manifest because you want DNN to index the module instances, you need to do the following:

  1. Add a manifest to the template with the necessary fields (see above)
  2. For every instance of the template use the function switch template, and reassign the template
  3. In the search site settings: push the re-index content button

The module content will now be indexed.

Step 2 is needed in case the template did not have a manifest before, it updates the modulesettings record with the correct SettingValue key (instead of the filename).