Technical support This forum is closed.
Version 1.x > Technical support > 1.6 Site Search issue with uploaded files View modes: 
User avatar
Member
Member
cpaul - 10/5/2005 8:16:15 PM
   
1.6 Site Search issue with uploaded files
When site search finds a hit in an uploaded pdf file, the link to it is returning a 404. The AliasPath and FilePath are different, and it doesn't look like Kentico can load the uploaded file by alias, only by the actual file path.

Any suggestions?

User avatar
Guest
admin - 10/6/2005 5:47:25 PM
   
Re: 1.6 Site Search issue with uploaded files
Hi Chip,

could you please write me what URLs are displayed in the search results?

Thank you.

Best Regards,

User avatar
Member
Member
cpaul - 10/6/2005 6:17:11 PM
   
Re: 1.6 Site Search issue with uploaded files
Here is an example:


TRC-HumanshRNAlibrary.pdf
Modified: 9/30/2005 10:10:20 AM
Path: > collateral > RNAi > inserts > TRC-HumanshRNAlibrary.pdf

And the link is http://www/collateral/rnai/pi/TRC-Human%20shRNA%20library

It should instead be http://www/collateral/rnai/pi/TRC-HumanshRNAlibrary.pdf

Here are the properties of the uploaded document
ID Path: /330/298/302/680
Alias Path: /collateral/rnai/pi/TRC-Human shRNA library
Name Path: /collateral/RNAi/inserts/TRC-HumanshRNAlibrary.pdf

User avatar
Guest
admin - 10/11/2005 5:55:12 PM
   
Re: 1.6 Site Search issue with uploaded files
Hi Chip,

I'm sorry for the delay. You need to use SearchResultRedirect.aspx file to redirect users to files correctly. Please see Developer's Guide -> Knowledge Base -> KB0007 for more details.

Best Regards,

User avatar
Member
Member
cpaul - 10/14/2005 4:48:29 PM
   
Re: 1.6 Site Search issue with uploaded files
This works for files, but now it won't work for other documents. They get sent to the top level page, not to the correct document using that template.

If you go to our search at http://www.openbiosystems.com/SiteSearch.aspx
And enter RHS1764, you can see the top link does not go to the product page, but the bottom file link opens correctly.

User avatar
Guest
admin - 10/15/2005 11:24:50 AM
   
Re: 1.6 Site Search issue with uploaded files
Hi Chip,

This was a default behavior in 1.6b and it was improved in version 1.7 (by the concept of editable regions).

You need to modify the 1.6b SearchResultRedirect.aspx page code. Please replace:

----------------------------------------------

//get nearest parent menu item
if (node.ClassName.ToLower() != "cms.menuitem")
{
pageDR = Functions.GetPageInfoDR((string) node.GetValue("AliasPath"));
if (pageDR != null)
{
//page found
newAliasPath = (string) pageDR["AliasPath"];
}
else
{
//page not found - it's root
if (node.ClassName.ToLower() == "cms.file")
{
//redirect directly to the file
newAliasPath = node.GetParentPath(TreePathTypeEnum.AliasPath) + "/" + (string) node.GetValue("FileName");
}
else
{
//redirect to home page
newAliasPath = "/";
}
}
}
else
{
newAliasPath = (string) node.GetValue("AliasPath");
}

----------------------------------------------

with

----------------------------------------------

if (node.ClassName.ToLower() == "cms.file")
{
//redirect directly to the file
newAliasPath = node.GetParentPath(TreePathTypeEnum.AliasPath) + "/" + (string) node.GetValue("FileName");
}
else
{
newAliasPath = (string) node.GetValue("AliasPath");
}

----------------------------------------------

Should you need any help with that, please feel free to contact me.

Best Regards,


User avatar
Member
Member
cpaul - 10/17/2005 9:26:20 PM
   
Re: 1.6 Site Search issue with uploaded files
Thank you very much, this worked perfectly.

We will soon be moving to 1.7, which will hopefully preempty all these questions I post about outdated versions.

User avatar
Member
Member
cpaul - 10/18/2005 12:22:19 AM
   
Re: 1.6 Site Search issue with uploaded files
On a similar note, is there a way to limit the site search to a set of top level nodes?

i.e. everything under a, b, and d but not search c and e?

User avatar
Guest
admin - 10/18/2005 8:51:46 AM
   
Re: 1.6 Site Search issue with uploaded files
Hi Chip,

Since version 1.7a, you can specify the document types or sections of the web site that should be excluded from the search results. I believe this should help in your case.

Example of web.config parameters:
<add key="CMSExcludeDocumentsFromSearch" value="/partners/%;/clients/%" />
<add key="CMSExcludeDocumentTypesFromSearch" value="cms.product;cms.news" />

Best Regards,