Example #1
0
        public static void GetItemsFromSearchResult(IEnumerable <SearchResult> searchResults, List <SkinnyItem> items, bool showAllVersions)
        {
            foreach (var result in searchResults)
            {
                var uriField = result.Document.GetField(BuiltinFields.Url);
                if (uriField != null && !String.IsNullOrEmpty(uriField.StringValue()))
                {
                    var itemUri = new ItemUri(uriField.StringValue());

                    var itemInfo = new SkinnyItem(itemUri);

                    foreach (Field field in result.Document.GetFields())
                    {
                        itemInfo.Fields[field.Name()] = field.StringValue();
                    }

                    items.Add(itemInfo);
                }

                if (showAllVersions)
                {
                    GetItemsFromSearchResult(result.Subresults, items, true);
                }
            }
        }
      public static void GetItemsFromSearchResult(IEnumerable<SearchResult> searchResults, List<SkinnyItem> items, bool showAllVersions)
      {
         foreach (var result in searchResults)
         {
            var uriField = result.Document.GetField(BuiltinFields.Url);
            if (uriField != null && !String.IsNullOrEmpty(uriField.StringValue()))
            {
               var itemUri = new ItemUri(uriField.StringValue());

               var itemInfo = new SkinnyItem(itemUri);

               foreach (Field field in result.Document.GetFields())
               {
                  itemInfo.Fields[field.Name()] = field.StringValue();
               }

               items.Add(itemInfo);
            }

            if (showAllVersions)
               GetItemsFromSearchResult(result.Subresults, items, true);
         }
      }