Try our conversational search powered by Generative AI!

Restrict search to language branch


I've built our site by modifying the public templates and I've got a little problem with the search function. It performs the search globaly and not just in the language branch that it concernes. I thoght removing the global-statement from SearchDataSource.SearchLocations = "~/Global/,~/Documents/,~/PageFiles/"; would do the trick but it still gets pages from the other branches. Is there any other place in which the global search can be removed?

Best regards,

Feb 02, 2010 9:41

Set the LanguageBranches property of the SearchDataSource (it's a comma separated list of language branch strings ("en" etc.)).

Feb 02, 2010 10:26

I totally missed that property. Thanks for the fast reply!

Feb 02, 2010 10:41


i am new to this concept of using search based on can i search based on language? If i stand in English language and if i type some text in search control it displays the results belonging to diff countries that match that can i filter those results?

Can anyone figure it out......Suggestions appreciable.....


Thanks in advance....

Sep 26, 2011 11:32

Add SearchDataSource.LanguageBranches = Locale((PageBase)Page); to your SearchDataSource.

Sep 26, 2011 11:36


i cant abe to add Locale keyword in my code. It required any name spaces?



Sep 26, 2011 12:12

Are you trying to add it in a page template or a web control?

Sep 26, 2011 12:49


I am adding it in .cs file of aspx page......

Sep 26, 2011 13:05

Then try CurrentPage.LanguageBranch.ToString(); instead.

Sep 26, 2011 13:13

Thank a lot......


It is working fine......once again thanks to u.......


Warm Regards,


Sep 26, 2011 13:49

Glad it worked out!

Sep 26, 2011 13:51
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.