Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Searching within document type View modes: 
User avatar
Member
Member
marty.nord-deaconess - 12/8/2011 1:54:39 PM
   
Searching within document type
Has anyone experienced any trouble trying to perform a search on a document type that contains a PDF file as one of your fields?

Thanks.


User avatar
Member
Member
kentico_michal - 12/9/2011 1:18:05 AM
   
RE:Searching within document type
Hello,

Kentico CMS provides a full-text searching. For more information, I would like to point you to the following section of developer's guide: Searching attachments.

Best regards,
Michal Legen

User avatar
Member
Member
marty.nord-deaconess - 12/15/2011 9:11:12 AM
   
RE:Searching within document type
I am exploring our options to see if anyone else has found a solution.

I have already worked with Kentico Support on this issue. After about 25 emails back and forth, we still do not have a working solution. The issue is very simple but for some reason the search is complex which makes no sense. We keep thinking the search functionality that we desire should be basic out of the box functionality.

We have a document type, PolicyProcedure, that contains several fields. I will only mention the three most important fields.

1.) Company field - a drop down list of company names
2.) Category field - a drop down list of department/category names
3.) PDF file

We have been trying to create a search page that contains the following:

1.) Keyword Search text box
2.) Company drop down list
3.) Category drop down list
4.) Search button

We want to be able to enter a word in the Keyword Search text box, select a company, select a category and click the Search button. The Search routine should search all PolicyProcedure records for that keyword as well as search within the PDF files for that keyword. In addition, it will also only return records for the selected company and category.

After 25 emails with support, we still don't have a solution. We also looked at the examples in the Corporate Site template but those searches are different. At this point, we are trying to find someone else who has done this search because we can't be the only company that desires to be able to search all fields of a document type as well within any included PDF files.

Thanks.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 12/15/2011 10:02:15 AM
   
RE:Searching within document type
Hi,

for readers of this thread:


The issue with this architecture is that if you are searching in attachments and using filters, you need to set up Search in attachment condition in the Smart search results web part. We do not know the content of your filters in advanced so we cannot do it in advanced.

Another point here - if you would like to search in the PDF files, you need to use a field type File, or attached file in Properties of document -> Attachment tab.

for Marty:


We stopped communication when:


What should be working now:
+ search on documents - if you search using word which is a part of document, not attachment, for example if you search for bid and have filters set to All or values which document contains (Entity: Deaconess Hospital, Category: Services and Supplies) - the correct document is returned.

+ searching in attachment - if you search for word hospital - the result is not found (if filters are set to All), but the search starts working if you set filter for example on Entity: Deaconess Hospital, Category: Services and Supplies.

What is not working now:
- searching in attachment if filters are set to All


I could not configure this using UI, you would need to create a macro as was described in the e-mail.

Could you please describe in more details what was not working so we could find solution?

Best regards,
Ivana Tomanickova

User avatar
Member
Member
marty.nord-deaconess - 12/15/2011 3:11:17 PM
   
RE:Searching within document type
We do not know how to build the described macro so we have been looking for alternatives.

Is there a way to build a similar search without using the search results web part altogether but instead write custom code using the API?

Thanks.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 12/22/2011 6:50:00 AM
   
RE:Searching within document type
Hi,

you can create a custom web part which will use SearchResult control (or better its custom clone):
~/CMSModules/SmartSearch/Controls/SearchResults.ascx

Using this control you can configure all properties dynamically in the code behind, so you do not need to write a custom macro.

In the code behind of your control you need to set AttachmentsWhere condition. Query parameters you can get using QueryHelper class. If the parameters are empty, then the value of property should be "". This way you will handle the situation, when filters are set to All.

Best regards,
Ivana Tomanickova