xoa*_*ail 2 lucene.net sitecore sitecore7 sitecore7.2
如何使用Sitecore.ContentSearch通过其字段(类型为droptree)值获取Sitecore 7.2中的sitecore项?
我试过了,context.GetQueryable<SearchResultItem>().FirstOrDefault(resultItem=>resultItem["Field Name"]=="{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}");但没有运气.有小费吗?
Guids以标准化格式(小写,没有连字符或大括号)索引.因此,如果您想以这种方式进行搜索,我认为您需要规范化搜索字词.
请参阅此博客文章的"略微复杂的查询"部分:http: //www.xcentium.com/blog/2013/11/05/sitecore-7-linq-to-sitecore-simplified-part-1
顺便说一句,如果使用映射的POCO而不是SearchResultItem进行查询,则可以避免必须手动执行该规范化.