EPiServer SearchDataSource 控件 UseFallbackLanguage 属性
UseFallbackLanguage 应如何影响搜索结果? 我有以下代码:
<EPiServer:SearchDataSource ID="uiSearchDataSource" runat="server"
EnableVisibleInMenu="false"
UseFallbackLanguage="true"
PageLink="<%# PageReference.StartPage %>"
LanguageBranches="<%# this.CurrentPage.LanguageBranch %>">
<SelectParameters>
<asp:QueryStringParameter Name="SearchQuery" QueryStringField="search" DefaultValue="" />
</SelectParameters>
</EPiServer:SearchDataSource>
我期望的是,如果我搜索“word”,那么应该以当前语言以及每个页面的所有后备语言来搜索它。这是正确的吗?
目前我没有看到真值或假值有任何区别。
How UseFallbackLanguage should affect search results?
I have a following code:
<EPiServer:SearchDataSource ID="uiSearchDataSource" runat="server"
EnableVisibleInMenu="false"
UseFallbackLanguage="true"
PageLink="<%# PageReference.StartPage %>"
LanguageBranches="<%# this.CurrentPage.LanguageBranch %>">
<SelectParameters>
<asp:QueryStringParameter Name="SearchQuery" QueryStringField="search" DefaultValue="" />
</SelectParameters>
</EPiServer:SearchDataSource>
And what I expect is that if I search for "word" then it should be searched in current language, and in all fallback languages for each page. Is thats correct?
Currently I don't see any difference in true or false value.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:
忘记下面的部分。 SearchDataSource 完全重写 Select 方法并使用 FindPagesWithCriteria。 UseFallbackLanguage 属性仅在 PageDataSource 上使用,在继承的 SearchDataSource 中根本没有任何作用。
该设置仅影响主语言回退。如果您找到的页面在当前语言中不可用,则将显示该页面的主语言版本。它在 SearchDataSource 继承自的 PageDataSource 的 GetChildren 中使用:< Strike>DataFactory.Instance.GetPage(new PageReference(pageID), LanguageSelector.AutoDetect(this.UseFallbackLanguage));
也是这样的完成是有错误的,我相信自动检测方法仍然存在错误。请参阅以下论坛帖子:http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=35269&epslanguage=enEDIT:
Forget the below part. The SearchDataSource completely overrides the Select method and uses FindPagesWithCriteria. The UseFallbackLanguage property is only used on the PageDataSource and has no effect at all in the inherited SearchDataSource.
The setting only affects master language fallback. If the page you found is not available in the current language the master language version of the page will be shown.It is used in the GetChildren of the PageDataSource which the SearchDataSource inherits from:DataFactory.Instance.GetPage(new PageReference(pageID), LanguageSelector.AutoDetect(this.UseFallbackLanguage));Also the way that this is done is buggy, I believe there is still a bug with the AutoDetect method. See the following forum post:http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=35269&epslanguage=en