Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Smart Search filter Query Culture wise View modes: 
User avatar
Certified Developer 8
Certified Developer 8
ashish.narnoli12-gmail - 8/19/2013 12:53:30 AM
   
Smart Search filter Query Culture wise
Hi,
I have setup the Multiculture website and currently the site having 2 cultures. One is 'en-GB' and other is 'en-US'.

For the smart search functionality, i created ProductIndex including both Cultures. When i try to search any Product (may or may not be common in both cultures), it returned Result as desired.

Including this, i created Smart Search filter having a query like:
"SELECT * FROM View_CLA_Category_Joined WHERE ShowInSearchFilters = 1 AND Published = 1 AND DocumentCulture LIKE '{%CMSContext.CurrentDocumentCulture.CultureCode%}'
Order By NodeLevel, NodeOrder ASC"

This will return No Result.

If i pass
"SELECT * FROM View_CLA_Category_Joined WHERE ShowInSearchFilters = 1 AND Published = 1 Order By NodeLevel, NodeOrder ASC"
This will create Duplicate copies of each node (because the Searched product belongs to that Same category name which is common in both culture)

If i pass
"SELECT * FROM View_CLA_Category_Joined WHERE ShowInSearchFilters = 1 AND Published = 1 AND DocumentCulture LIKE 'en-GB'
Order By NodeLevel, NodeOrder ASC"

This returns the desired filter output.

So, my question is, where i am doing mistake for the Search filter?

Suggestions are highly appreciated :)

Thanks
Ashish Narnoli

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/20/2013 1:25:50 AM
   
RE:Smart Search filter Query Culture wise
Hi,

Could you please use the macro debug to see if your macro in the SQL query is resolved correctly?

Best regards,
Juraj Ondrus

User avatar
Certified Developer 8
Certified Developer 8
ashish.narnoli12-gmail - 8/20/2013 3:31:17 AM
   
RE:Smart Search filter Query Culture wise
Hi Juraj,
Thanks for your reply.

Actually i figured out the issue and fixed it. I just passed the current culture to the Query instead of using Macro like below:

"SELECT * FROM View_CLA_Category_Joined WHERE ShowInSearchFilters = 1 AND Published = 1 AND DocumentCulture LIKE @DocumentCulture Order By NodeLevel, NodeOrder ASC;"

It is working fine.

Thanks,
Ashish Narnoli