Hi, I've developed a custom DNN Article module for a client, it's mostly based in WebForms controls for SQL CRUD functionality in the backoffice and sqldatasources and repeaters for displaying the results in lists and detail pages, all the code behind we have is C# based
I've downloaded the Aricie.LuceneSearch project and found the XepientDocumentLibraryProvider.cs to inspire me doing a custom provider to my module, first I hardcoded some content just to see if I could see some result in the search that is already working for the preinstalled providers... then I needed to register this provider, but despite I'm not able to do anything in the button "Add Providers" I was able to edit a pre installed provider and put my .net qualified type, then I already clicked on index this portal's content, also manually asked the schedulers to execute, but there are no new results in the search when using the hardcoded content I used in my POC custom provider for my custom module
Can you point me in a right direction, what must I check, where to debug, where are the providers registrations get stored, etc ?
Thanks!
Hello Rodrigo,
I've just tested the behavior of a custom provider on this site and I cannot reproduce the problem you're having. I have been able to add a provider, edit it and save the configuration. When indexing the portal manually, I had set up a breakpoint in the GetSearchItems method of the custom provider and it was hit by the indexing engine.
What is guess is happening is that you're basing your work on an upgrading provider, whose behavior is to add search criterias to a module already returning searchable data to DNN. You need to implement the ISearchable interface instead of the ILuceneSearchableUpgrade. There is a series of blog posts I wrote about writing your custom providers which could help, the second one may be of interest. Keep us posted to know if you managed
Regards,
Samy
Hi samy, you are right, I was using the Providers\SearchProviders\Aricie.XepientOpenDocLuceneProvider\Components\Lucene\XepientDocumentLibraryProvider.cs as example because it was the only C# example I found in the module source, but then I saw that it only implements ILuceneSearchableUpgrade, ILuceneFieldGlossary
After reading your blog posts again I first had some problems because my custom module don't have a controller class, it's just a bunch of ascx files using sqldatasource and repeaters to list some data (news) from database.... My module was already registered and I didn't understand how to "Configure the provider by setting the ModuleName xml value to the name of the module you want to plus into the search system" because the module was already registered, it was created by the Create New Module button on the extensions page, using the "From Control" option to select my user controls (ascx)
Then I used the option to Create a Package from my module and tweaked the manifest and I was able to see that my test provider was called because using the Luke Tool I was able to find the "Documents" with my "Fields" and data from my custom provider test (inheriting from ILuceneStandAloneSearchable implementing the GetSearchItems(int portalId) method).
But something happened to my portal that the results module is not finding any results, I guess it's something related to me trying to turn off all the Indexing options (unchecking HTML in the 'Indexing > search modules' and "Enable document indexation" because when I was trying to debug I was seeing a lot of file not found exceptions so I figured it out that was better disable everything except my custom provider... but now that I see that all the data is inside the index (using Luke), all my HTML content, all my Documents, and also the custom provider content (mocked in a hardcoded custom provider test), I tried to revert all the settings to the default settings (I used another DNN install to compare the settings) but it didnt work
I also tried compile the Aricie.LuceneSearch, I fixed some 'exceptions' that was happening in my initial tests (like the TabInfo property on LuceneSearchResultsInfo.vb file that sometimes don't have the Me.TabId inside LuceneContext.Instance.CurrentTabs or some try/catch around GetFilter() method on LuceneFilterContainer.vb or a "If objCtl IsNot Nothing Then" before "objCtl.Controls.AddAt(0, objBackButton)" at SearchSkinObject.ascx.vb) but then I started to see a lot of settings becoming disabled saying that "This is a lite version of LuceneSearch. Disabled fields will be available in the standard and the source versions of the module which you can purchase onhttp://www.aricie.comand Snowcovered." or "This feature is disabled in the lite version of LuceneSearch. Please upgrade to access all features." but I'm using the source version, isn't it supposed to be 'free' ?
I tried reinstall the module (uninstall the extension, upload the extension again) but the results never shows up!
My only alternative now is to recreate the site from zero, which is not feasible now, there are a lof of pages, two sites (portalid 0 and 1), two languages (pt-br and en-us), a lof of instances of my custom modules with a lot of module settings to reconfigure if I go down this path...
I'm going mad trying to figure it out what is happening !
Hello,
It is not necessary for a module to have a controller in order to link a search component to it, as you've found out. So you shouldn't have to add a controller to your module, or tweak it. As well the index doesn't necessarily needs to match the current configuration. If an index has old entries you can delete and rebuild it.
Regarding the LuceneSearch compilation, you have to make sure to use the correct build configuration to avoid the limitation messages for the module (look for the Debug/Release vs the Debug Trial/Release Trial configuraitons). You should not encounter build errors though, could you point out line numbers where the errors occur?
If I've understood correctly, the indexation works correctly but the results are not showing up. Perhaps your query is filtering too much out of the items, you could perhaps have a look at what is queried by Aricie.LuceneSearch. There are some elements that could be responsible for the lack of results: security filters, or language filters... What I'd recommend is taking a look at what query is built out of your configuration and compare it to the query that you would use with Luke. To take a look at the built query, you can attach to the BuildQuery method in the PortalQueryingDriver class
BuildQuery
PortalQueryingDriver
Let me know if you find out what results you get
Hi Samy, thanks for your help,
The errors I found were in runtime, not compiling, the fixes were in "'exceptions' that was happening in my initial tests (like the TabInfo property on LuceneSearchResultsInfo.vb file that sometimes don't have the Me.TabId inside LuceneContext.Instance.CurrentTabs or some try/catch around GetFilter() method on LuceneFilterContainer.vb or a "If objCtl IsNot Nothing Then" before "objCtl.Controls.AddAt(0, objBackButton)" at SearchSkinObject.ascx.vb)" that was the main motivation to compile
I will try the other build configurations you mentioned looking to avoid the limitation messages
Yes, the indexation looks OK, and the results is not showing up. Thanks for the tip about may be filtering too much, I will look into what the query is coming to Aricie.LuceneSearch... I spent this night trying to implement a custom results module (using LuceneResultsControlBase) but my 'minimum code' (based on page 35 of luceneSearch pdf) to test it is throwing " Object Reference not found error at:
em DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl()
"
Something strange is that the default DNN results module is able to find results for a ModuleSearchBase test implementation (using the DNN native recipe), but not in the native DNN HTML modules
It's also strange that this content (in the ModuleSearchBase test) appears only in the DNN "App_Data/Search" index (using Luke to view), not in the "Aricie.LuceneIndex" index, and the ILuceneStandAloneSearchable (Custom provider Aricie recipe) test implementation content only appears on the "Aricie.LuceneIndex" index but not in the DNN "App_Data/Search" index
HTML content is also on the "Aricie.LuceneIndex" index but not in the DNN "App_Data/Search" index
And PDF (documents) content only in the "Aricie.LuceneIndex" index (as expected)
I will get some sleep now and this afternoon (here in brazil) I will return to this quest, thanks for the tips!