Create search scopes for external content types

I have two external content types, both from the same external source. Now I want to create search scopes for each of the external content types.

My first try was to filter by content type. Unfortunately this is not possible as the managed metadata property has the value for Retrievable set to false. Timmy Gilissen explains how to see which properties can’t be retrieved: http://www.moss2007.be/blogs/timmy/archive/2011/08/10/core-results-webpart-fetched-properties-issue.aspx

The solutions that I have found is certainly not ideal, but it works in my case:
Since each external content type hase a seperate web part page bound to the as default page, I was able to define the search scopes, by using the existing managed property ‘FileName’.

Using TaxonomyWebTaggingControl in custom webpart makes CreateChildControls called twice!

The TaxonomyWebTaggingControl is a great control to use in your custom code, but when adding this control to a custom webpart I experienced my code running twice! I don’t know if this behaviour is specific to this control, but I have been able to isolate the behaviour to this control in my webpart.

Don’t have a solution to this :-(

The first call has the following stacktrace:
MyAssembly.dll!MyAssembly.MyWebPart.MyWebPart.CreateChildControls() Line 86 C#
System.Web.dll!System.Web.UI.Control.EnsureChildControls() + 0x92 bytes
System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0x3d bytes
System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0xe0 bytes
System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0xe0 bytes
System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0xe0 bytes
System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0xe0 bytes
System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0xe0 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint) + 0xd42 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint) + 0xa0 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x5b bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0xf0 bytes
System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x257 bytes
System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step, ref bool completedSynchronously) + 0xab bytes
System.Web.dll!System.Web.HttpApplication.PipelineStepManager.ResumeSteps(System.Exception error) + 0x511 bytes
System.Web.dll!System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext context, System.AsyncCallback cb) + 0x72 bytes
System.Web.dll!System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context) + 0x269 bytes
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x411 bytes
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x2b bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x540 bytes
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x2b bytes
[Appdomain Transition]

Stacktrace second call:
MyAssembly.dll!MyAssembly.MyWebPart.MyWebPart.CreateChildControls() Line 86 C#
System.Web.dll!System.Web.UI.Control.EnsureChildControls() + 0x92 bytes
System.Web.dll!System.Web.UI.WebControls.WebParts.Part.Controls.get() + 0x14 bytes
System.Web.dll!System.Web.UI.Control.LoadChildViewStateByIndex(System.Collections.ArrayList childState) + 0x22 bytes
System.Web.dll!System.Web.UI.Control.LoadViewStateRecursive(object savedState) + 0x18b bytes
System.Web.dll!System.Web.UI.Control.LoadChildViewStateByID(System.Collections.ArrayList childState) + 0xb4 bytes
System.Web.dll!System.Web.UI.Control.LoadViewStateRecursive(object savedState) + 0x17b bytes
System.Web.dll!System.Web.UI.Control.LoadChildViewStateByIndex(System.Collections.ArrayList childState) + 0xe8 bytes
System.Web.dll!System.Web.UI.Control.LoadViewStateRecursive(object savedState) + 0x18b bytes
System.Web.dll!System.Web.UI.Control.LoadChildViewStateByIndex(System.Collections.ArrayList childState) + 0xe8 bytes
System.Web.dll!System.Web.UI.Control.LoadViewStateRecursive(object savedState) + 0x18b bytes
System.Web.dll!System.Web.UI.Control.LoadChildViewStateByIndex(System.Collections.ArrayList childState) + 0xe8 bytes
System.Web.dll!System.Web.UI.Control.LoadViewStateRecursive(object savedState) + 0x18b bytes
System.Web.dll!System.Web.UI.Control.LoadChildViewStateByIndex(System.Collections.ArrayList childState) + 0xe8 bytes
System.Web.dll!System.Web.UI.Control.LoadViewStateRecursive(object savedState) + 0x18b bytes
System.Web.dll!System.Web.UI.Page.LoadAllState() + 0x234 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint) + 0x748 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint) + 0xa0 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x5b bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0xf0 bytes
System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x257 bytes
System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step, ref bool completedSynchronously) + 0xab bytes
System.Web.dll!System.Web.HttpApplication.PipelineStepManager.ResumeSteps(System.Exception error) + 0x511 bytes
System.Web.dll!System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext context, System.AsyncCallback cb) + 0x72 bytes
System.Web.dll!System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context) + 0x269 bytes
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x411 bytes
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x2b bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x540 bytes
System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x2b bytes
[Appdomain Transition]