The new awesome Lucene based Search was introduced in DNN Platform 7.1. Subsequently, User Search feature was added in DNN Platform 7.2. As the name suggests, User Search allowed fast searches based on User's profile properties such as first name, last name, city, etc. Obviously, one can search for a user's profile property only when that property was visible to person the performing the search.
Although this feature was very well received in general, some DNN Users were looking for ways to disable it. In 7.4.0, we have introduced hidden host settings to optionally disable running of User Search Indexing. Here is how to do it:
CAUTION
Since the steps are rather manual, it is best to take both database and file backup of the site prior to taking any of these steps. Some of the new features in Commercial products rely on User Search, so turning it off will have adverse affect there.
AN EASY WAY FIRST
Since the new Search was added in 7.1, Administrators always had the ability to disable "User Search Results". Here is how to do it:
- Go to Search Results page > Go into Edit Mode > Search Results module settings > Search Results settings tab >
- Results Scope for Content Type(s) > Uncheck Users > Update
Please note that while this still serves the same purpose of making Users not searchable, but the approach is very different from what I am about to discuss below. The steps below will prevent the Users from getting indexed in the first place as opposed to preventing them being discovered through Searching after the fact. So, all you want is to prevent the Searching aspect, the "easy way" is good enough.
STEP 1 - ENSURE NO SETTING
Run the following SQL to ensure that there are no existing setting
select * from dnn_hostsettings where settingname = 'DisableUserCrawling'
STEP 2 - Notice Current Schedule LOG
Go into Host > Schedule > Search: Site Crawler and click on history icon to observe current log. You will notice that it lists "Users Indexed: 999" indicating the number of Users it indexed in the run.
STEP 3 - Execute Stored PRocedure to DISABLE User SEARCH
Open SQL Server Management Studio of Host > SQL in DNN and run the following SQL:
EXEC dnn_AddHostSetting @SettingName = N'DisableUserCrawling',
@SettingValue = N'Y',
@SettingIsSecure = 0,
@CreatedByUserID = 1
STEP 4 - Verify NEW SETTING IS IN PLACE
Run the following SQL to ensure that new setting is in place (same as step 1)
select * from dnn_hostsettings where settingname = 'DisableUserCrawling'
Note that the setting should be uppercase Y.
STEP 5 - Clear CACHE
Any change done to the database is usually not seen by the application, unless cache is cleared or the application pool is recycled.
STEP 6 - RUN SCHEDULED TASK AND VERIFY RESULT
Go into Host > Schedule > Search: Site Crawler and click on history icon to observe current log. You will notice that it no longer lists "Users Indexed: 999" section.
What IF YOUR SITE HAD ALREADY INDEXED USERS
You need to do the following:
- Disable "Search: Site Crawler" scheduled task. Go Host > Schedule > Search: Site Crawler > Edit > Uncheck "Schedule Enabled" > Update
- Stop Application Pool and delete Search Folder at Website\App_Data\Search
- Re-Index for all the Sites (Portals) you have. For each Site, go into Admin > Search Admin > Re-Index.
- Enable "Search: Site Crawler" scheduled task. Go Host > Schedule > Search: Site Crawler > Edit > Check "Schedule Enabled" > Update
- Run Schedule. Go into Host > Schedule > Search: Site Crawler > Edit > Run Now. This will force entire site to be re-indexed, so you may see CPU spikes
Please note that in a future release, we will remove the need to do the above. We'd make sure that this new Host Setting is respected by the Search skin object and the Search Results module.
HOW TO REVERT
If you need to allow the User Indexing, simply go ahead and delete the setting, and Re-Index (see just above). Run the following SQL to delete. No need to delete the Search folder though.
DELETE dnn_hostsettings where settingname = 'DisableUserCrawling'