Sharepoint 2013 query builder fails to load

I have restored SharePoint 2013 site from a backup.

No If i try to load the query builder from "Change query" option in content search webpart or from "Add Query Rule" from site settings I get "Unknown error occured" mean while query builder loads in other site collections.

On analysing log files this is the error message 


"Exception in Query Builder OnLoad: System.ArgumentException: An entry with the same key already exists.    
 at System.Collections.Generic.SortedList`2.Add(TKey key, TValue value)    
 at Microsoft.Office.Server.Search.Internal.UI.QueryBuilder.PopulateContentTypesDropDown()    
 at Microsoft.Office.Server.Search.Internal.UI.QueryBuilder.OnLoad(EventArgs e)"

Is there any resolution for this issue?

May 10th, 2013 10:59pm

Karthik,

The issue occurs when a site has multiple list items with the same title.

Free Windows Admin Tool Kit Click here and download it now
May 13th, 2013 2:03pm

This issue happens when same content type is added to root site and the subsites. Removing one content type fixed the issue.

Thanks Vadivelu for the pointer..

May 16th, 2013 4:52pm

I have the same issue as well as the same error appearing in my logs. However, I do not see any root sites and subsites with the same name.  Our search page is it's own site collection and I am attempting to add a new search page with a people search page layout. Could someone explain to me a little clearer where I should be looking to see where the duplicate content types might be? Should I compare the types for the new people search page against that of the top level search page?

Free Windows Admin Tool Kit Click here and download it now
September 24th, 2013 1:41am

Confirmed it's the same content type issue.  My case is after promoting a site (SPWeb) to site collection (SPSite) and the workflow content type got carried over and stuck there. I ran a powershell script:

$web = Get-SPWeb "http://mywebsite.com"

if($web -ne $null)
{
    foreach($ctype in $web.ContentTypes)
    {
        write-host $ctype.name
    }
}

and found out these content types were showing up twice.  

Approval Workflow Task (en-US)
Approval Workflow Task (en-US)
Collect Feedback Workflow Task (en-US)
Collect Feedback Workflow Task (en-US)
Collect Signatures Workflow Task (en-US)
Collect Signatures Workflow Task (en-US)
Signatures Workflow Task Deprecated

Signatures Workflow Task Deprecated

Confirmed no duplicates after disabling the site collection Workflow feature and the query builder started working again.


  • Edited by aauxta Thursday, October 23, 2014 7:12 PM
October 23rd, 2014 10:11pm

I know this is a bit older of a post, but was going to suggest running the following PowerShell as well to see if it spits out the Content Type it is dying on:

try { $web = Get-SPWeb http://sharepoint/sites/web $ctypes = $web.AvailableContentTypes $table = New-Object System.Collections.Hashtable foreach ($ctype in $ctypes) { Write-Host "Adding cotnent type "$ctype.Name $table.Add($ctype.Name, $ctype) } } catch { Write-Host "Exception ocurred while adding cotnent type" $_.Exception.Message }

Free Windows Admin Tool Kit Click here and download it now
January 20th, 2015 12:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics