asp.net – 从umbraco搜索中排除节点
发布时间:2020-12-16 09:24:16 所属栏目:asp.Net 来源:网络整理
导读:我已经创建了umbraco搜索,其中我想要一些不应该被搜索的节点,所以我可以做的是我应该在搜索条件中定义或sholud我在检查配置文件的设置或索引设置代码中做一些事情 IndexSet SetName="DemoIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/DemoIndex/"In
我已经创建了umbraco搜索,其中我想要一些不应该被搜索的节点,所以我可以做的是我应该在搜索条件中定义或sholud我在检查配置文件的设置或索引设置代码中做一些事情
<IndexSet SetName="DemoIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/DemoIndex/"> <IndexAttributeFields/> <IndexUserFields/> <IncludeNodeTypes/> <ExcludeNodeTypes> <add Name="News" /> </ExcludeNodeTypes> </IndexSet> 并检查设置文件 <add name="DemoIndexer" type="UmbracoExamine.LuceneExamineIndexer,UmbracoExamine" runAsync="true" supportUnpublished="false" supportProtected="true" interval="10" analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer,Lucene.Net" indexSet="DemoIndexSet"/> 和用户控制代码是 public static class SearchResultExtensions { public static string FullUrl(this SearchResult sr) { return umbraco.library.NiceUrl(sr.Id); } } SearchTerm = Request.QueryString["s"]; if (string.IsNullOrEmpty(SearchTerm)) return; SearchResults = ExamineManager.Instance.SearchProviderCollection["DemoSearcher"].Search(SearchTerm,true).ToList(); SearchResultListing.DataSource = SearchResults; SearchResultListing.DataBind(); 解决方法
如果要排除节点类型,只需将其放在IndexSet标记之间
<IndexSet ...> ... <ExcludeNodeTypes> <add Name="NameNodeType" /> </ExcludeNodeTypes> </IndexSet> 有关codeplex examine的更多信息 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- .net – 为什么在单击按钮时,SelectedIndexChanged会触发Dr
- asp.net-mvc – 如何提交本地jqgrid数据和表单输入元素
- asp.net – 如何使用EntityFramework种子数据代码第一次迁移
- asp.net-core – 如何在Visual Studio 2015 RC中为ASP.NET
- asp.net – 如何引用一个javascript文件?
- asp.net – 在自动生成的GridView列中防止HTML编码
- asp.net-mvc-2 – ASP.NET MVC 2并列为隐藏值?
- 勾选复选框时,禁用一些ASP.Net验证控件
- ASP.NET OutputCache和Cookies
- asp.net – 限制可以输入’textarea’的文本数量的最佳方法
推荐文章
站长推荐
- asp.net-mvc – 如何在Asp.net MVC中添加WebApi,
- asp.net-mvc – 使用模型对象更新ModelState
- asp.net-mvc – StackExchange.Redis.IDatabase存
- 什么是您最喜欢的ASP.NET添加工具/工具以提高生产
- asp.net – 一些黑客可以从用户窃取cookie,并在网
- ASP.NET AJAX AsyncFileUpload UploadedComplete
- asp.net – UserControl有IsPostBack,但是Contro
- asp.net-mvc – ASP.NET MVC中Controller.ReadFr
- 手动搭建自己的nuget服务器及使用
- asp.net-mvc – 在ASP.NET MVC 3中自定义模型绑定
热点阅读