Learn More





Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Custom Search in 7.1Custom Search in 7.1
New Post
8/20/2013 12:16 PM


Hi, I'm new to DNN, having been an Umbraco developer for a few years. I have a client who wants to use DNN for the greater out of the box feature set, and struggling through the differences. They have very specific search requirements, which I'm trying to work out how to achieve. 

They want user search, to begin with, very much like faceted search, and AJAX results-as-you-type.

I've looked at Aricie, which has everything but faceted search but won't yet run on 7.1 reliably, and Search Boost, which would be perfect if it had results-as-you-type, but looks tricky to add that too; just looking at what could be done with the out of the box stuff, so here's a post I added to the Community Participation with so far no response:

Is there any documentation for creating custom search crawlers for the new Lucene search?

1. I have created a SchedulerClient that is a very simplifier DotNetNuke.Services.Search.SearchEngineScheduler

2. I have added a new row to the SearchTypes table in the database, and used this ID in the hardcoded SearchDocuments in my TestIndexer

3. For the above, I have created a TestResultController based on DotNetNuke.Services.Search.Controllers.TabResultController (just returns true for HasViewPermission and a fake URL)

4. I installed my scheduler and ran it, and I now get my test items appearing in the search box - result!


1. I can see why a separate scheduler is a good idea; in fact, I would need one for my purposes anyway; but how much of what it does is required? I presume the delete, but what about the compact?

2. I really don't like having to manually INSERT the search type into the DB - is there a management interface for that I'm missing? (I'm very new to DNN, trialling it for a switch from Umbraco)

3. Obviously need a result controller for custom types, but how can I change the templates? I need a different look for all of the custom crawlers, both in the AJAX results and the main page.

Re: 3 - it looks like the search results are generated in the Javascript files Resources/Search/SearchSkinObjectPreview.js for AJAX, and DesktopModules/Admin/SearchResults/dnn.searchResult.js

That's not very custom-friendly; is there any way of getting the portal to use different files to avoid custom changes being overwritten on upgrades?


New Post
8/20/2013 5:39 PM
@Rob - Thanks for asking the question (BTW I am working on a blog on this 

topic as well). You are on the right track.

Here are the steps to create custom crawler:
1) Define a new SearchType. There is no UI for this. I don't expect we'll 

create one. This can be easily created by using APIs or using SQL. If you 

are using 7.1.1, set the IsPrivate column to true so the content doesn't 

get automatically searchable throuh site search

2) Provide the appropriate SearchResultClass in the SearchType. This class 

must implement BaseResultController.

2.a) You could store Url in the Document itslef or provide concrete 

implementation BaseResultController.GetDocUrl override.

2.b) Likewise you need to return true / false for HasViewPermission emthod 


3) Write a Scheduled Task by implementing SchedulerClient and creating 

appropriate entries for Scheduler.

4) This Scheduled Task should call AddSearchDcoument method(s) to store 

information in Lucene. Please note that this API is still in internal 

namespace as it may have (file locking) issues in a web farm. However, 

when running under Scheduler and provided task is configured to run on the 

same web head where other crawlers are running, there should not be any 


5) You should now be able to Search for content once this task kicks off 

(unless you are using IsPrivate = true from 7.1.1)

Answers to your questions:
1. You don't need to implement Compact. For deletes all you need to do is 

set IsActive = false in the SearchDocument. E.g. User creates ContentA, 

ContentB and ContentC. Your scheduled tasks runs and stores all the three 

content into three separate SearchDocuments. Now user deletes ContentB. 

You should ideally soft-delete this item from your table and flag it as 

deleted. When the scheduled task runs again you should submit contentB 

again with IsActive=false. This will remove the entry from Lucene.

2. We don't expect Admins to tweak with SearchTypes - this is more like 

Developer setting, which is why it should be done using API or SQL.

3. The only configuration option we have for the SearchResults page are 

CSS and Filter on SearchTypes (or modules). What specifically are you 

looking for?

Ash Prasad
Director of Engineering
DNN Corp.
New Post
8/20/2013 5:42 PM
there used to be a free user directory module by Effority with this feature, unfortunately it has issues in DNN7, but maybe you have a chance to get it to run:

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
New Post
8/21/2013 5:46 AM

Thanks Ash, good to know I'd got it basically right! I have been getting some file locking issues actually, although I'm not running a webfarm. However might just be from my constant file updates so not too worried right now.

Some more queries:

Point 1. Can you clarify what IsPrivate does?  I want this to be automatically searchable, don't I? It's doing what I expect with IsPrivate set to 0, anyway.

Question 1. My custom searches will be coming from places I have no control over the delete process; if they don't come with a soft-delete flag I presume then I will need to delete them from Lucene myself?

Question 3. Okay, a bit of background. The requirement is for a "unified" search, similar to LinkedIn; so the user types in "bulgaria" say, and gets a results with content containing "bulgaria", users from Bulgaria, and 3rd party datastore results matching "bulgaria".

Each of these types will be pretty different objects, although obviously there will be enough crossover to allow searching.

The client would like a clear interface to differentiate the object types. On the autocomplete, that is obviously quite basic, but still important.

On the main search results, it's a lot more important; so content pages should be displayed pretty much as-is. Users should be tiled with a photo and bio etc. 3rd party results will depend on the actual object type. The display should be categorised by object type:


    Bulgarian branch opens

    Bulgaria wins sales figures for Q4

Users (would be tiled in actual site)

    Anka Draganov

    Boris Georgiev

Is that at all possible?

Couple more questions:

1. How do I set the friendly display name for the search type I've created so the AJAX dropdown shows a nice category name?

Couple of questions on categorisation of results:

2a. If I search for a term contained in both content and my custom index, the autocomplete breaks it down by result type; it has the heading Pages, then two results, then the heading custom1 and the single result - as expected.

However, the main results put everything together - I get one page, one custom, then the second page. I need this grouped by search type - is that possible?

2b. Results with the same URL are grouped, correct, even if the Unique ID is different? Actually, that makes perfect sense, fine.

3. Would I be better looking at creating a custom module? I was trying to avoid that due to unfamiliarity with DNN, timescales, and the fact the built-in search very very nearly does what I want. Is it possible to easily create a custom module that basically duplicates the search so I can then modify it without worrying about updates to the core?

Again, thanks so much for quick reply and help!

New Post
8/21/2013 5:48 AM

Thanks Sebastian, but a key requirement of this project is unified search, so everything on the same page and everything in the AJAX results - not sure a separate directory is a good starting point tbh, although I'll take a look to see how they enumerate the users!

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Custom Search in 7.1Custom Search in 7.1

These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  

What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out