Restrict search to language branch

Vote:
 

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,

#36537
Feb 02, 2010 9:41
Vote:
 

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

#36538
Feb 02, 2010 10:26
Vote:
 

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

#36539
Feb 02, 2010 10:41
Vote:
 

Hi,

i am new to this concept of using search based on language.........how 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 text......how can i filter those results?

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

 

Thanks in advance....

#53900
Sep 26, 2011 11:32
Vote:
 

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

#53901
Sep 26, 2011 11:36
Vote:
 

Hi,

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

 

 

#53903
Sep 26, 2011 12:12
Vote:
 

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

#53905
Sep 26, 2011 12:49
Vote:
 

HI,

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

#53906
Sep 26, 2011 13:05
Vote:
 

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

#53907
Sep 26, 2011 13:13
Vote:
 

Thank a lot......

 

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

 

Warm Regards,

KRISHNA.

#53908
Sep 26, 2011 13:49
Vote:
 

Glad it worked out!

#53909
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.