Technical support This forum is closed.
Version 1.x > Technical support > CMSSearchResults / searchtree question View modes: 
User avatar
Member
Member
wahid - 5/19/2005 9:48:48 PM
   
CMSSearchResults / searchtree question
Hi,

I am using CMSSearchResults to display search results. In the documentation, it says that CMSSearchResults uses "searchtree" queries with each document template.
I don't want images that were uploaded to be listed, so I modified the "searchtree" query for the CMS.File template, and I added " AND [FileMimeType] Not Like 'image%' ".
But images are still listed. I tried the same query in the QueryAnalyser, it worked.
Is this normal?

Is there another way to filter results without rewriting another control, or using the API?

Thank you.

User avatar
Guest
admin - 6/8/2005 6:04:26 PM
   
Re: CMSSearchResults / searchtree question
Hi Wahid,

I'm very sorry for the delay. This is actually caused by the fact that the Proc_CMS_Tree_SearchTree stored procedure is always called for searching content. This procedure searches document names of all documents (NodeName column in the CMS_Tree table). You may need to modify the procedure, so that is doesn't search in files:

CREATE PROCEDURE Proc_CMS_Tree_SearchTree @Expression nvarchar(1000), @IDPath nvarchar(450)

AS

SELECT *, NodeName as SearchResultName
FROM view_cms_tree_joined
WHERE IDPath LIKE @IDPath and NodeName LIKE '%'+ @Expression +'%' and className <> 'cms.file'

Then, you will still be able to search other CMS_File table columns using the searchtree query of the CMS.File document type.

Best Regards,