From 2ba7cdc7891e8d12ad04f243a9c526b8a6e782a2 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 19 Nov 2015 19:06:31 +0100 Subject: [PATCH] Fixes: U4-6659 Examine: Specific doctype not being indexed --- src/UmbracoExamine/BaseUmbracoIndexer.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/UmbracoExamine/BaseUmbracoIndexer.cs b/src/UmbracoExamine/BaseUmbracoIndexer.cs index d5a9d6f233..ee77f5d05c 100644 --- a/src/UmbracoExamine/BaseUmbracoIndexer.cs +++ b/src/UmbracoExamine/BaseUmbracoIndexer.cs @@ -460,8 +460,19 @@ namespace UmbracoExamine if (xDoc != null) { var rootNode = xDoc.Root; - - AddNodesToIndex(rootNode.Elements(), type); + if (rootNode != null) + { + //the result will either be a single doc with an id as the root, or it will + // be multiple docs with a wrapper, we need to check for this + if (rootNode.HasAttributes) + { + AddNodesToIndex(new[] {rootNode}, type); + } + else + { + AddNodesToIndex(rootNode.Elements(), type); + } + } } }