Sitefinity 5.1 and Document Library Full Text Search
I know that Sitefinity does not not support searching of the document libraries out of the box, let alone doing full text search of their contents. So I am writing my own module (hopefully) to do this.
Looking at some of the examples and documentation, it looks like I would want to use an inbound pipe to tie into the publishing system to generate the index information for each document as they are saved (Using various libraries to parse the document and return the text contents). I think I have that mostly accomplished, but I'm missing something.
I have created the module, and registered it. My initialize code looks like this:
01.
PublishingSystemFactory.RegisterPipe(DocumentSearchInboundPipe.PipeName,
typeof
(DocumentSearchInboundPipe));
02.
var mappingsList = PublishingSystemFactory.GetDefaultInboundMappingForContent();
03.
PublishingSystemFactory.RegisterPipeMappings(DocumentSearchInboundPipe.PipeName,
true
, mappingsList);
04.
05.
var pipeSettings = (SitefinityContentPipeSettings)PublishingSystemFactory.CreateDefaultContentInboundPipeSettings(DocumentSearchInboundPipe.PipeName);
06.
pipeSettings.ContentTypeName =
typeof
(Telerik.Sitefinity.Libraries.Model.Document).FullName;
07.
pipeSettings.UIName =
"DocumentSearchInboundPipe"
;
08.
pipeSettings.PipeName = DocumentSearchInboundPipe.PipeName;
09.
pipeSettings.ResourceClassId =
typeof
(DocumentLibraryFullTextSearchModuleResources).Name;
10.
PublishingSystemFactory.RegisterPipeSettings(DocumentSearchInboundPipe.PipeName, pipeSettings);
11.
12.
var definitions = PublishingSystemFactory.CreateDefaultContentPipeDefinitions();
13.
PublishingSystemFactory.RegisterPipeDefinitions(DocumentSearchInboundPipe.PipeName, definitions);
14.
15.
var contentPipeSettings = PublishingSystemFactory.GetPipeSettings(DocumentSearchInboundPipe.PipeName);
16.
contentPipeSettings.MaxItems = 0;
17.
PublishingSystemFactory.RegisterTemplatePipe(
"SearchItemTemplate"
, contentPipeSettings, ps => ps.PipeName == DocumentSearchInboundPipe.PipeName);
Ok, I think I got it now. I wasn't registering the Resources file, and I think it wasn't being pulled in right because of that.
This should be coming out of the box with 5.1 in July though?
Oh. That's cool. Wish I'd seen that before. but that's ok, I needed this right now anyway.
I know, I'm always dancing that line of...do it now even though it'll be here later, or just wait on it...
Hmm, doesn't look like they are doing Word docs though? I'm just scanning the OpenXML ones (docx), but still, figured they would include that. Also wonder what library they are using for PDF reading. I'm using an old copy of iTextSharp (Before the fork to new licensing scheme).
Steve, I have version 6.1 and the documents check box is checked in the index configuration. Yet, none of my pdfs is getting searched. What do they mean by the "documents" then? Not the documents that are stored in the libraries?