0

I am trying to use the Content Search Web Part and am having trouble. My query is configured and the test result panel is returning the desired results, yet when I save the web part, nothing is being rendered on the page. I am not yet using this for Cross-site collection queries but have enabled the Cross-Site Collection Publishing feature anyways.

Other Web Part Properties:

Display Templates = { Control: "List"; Item: "Two Lines"}

Property Mappings = {Link URL: "Path"; Line 1: "Title"; Line 2: "Description"}

Settings = {Query Results provided by: "This Web Part"; Result Table: "RelevantResults"; Start displaying results from result number: "1"}

I cannot figure out why the results show up in my test query yet I get no results on the page. Any help is appreciated.

2
  • Did you run the Searchcrawler after the configuration? Is everything published correctly? Commented Dec 3, 2014 at 16:25
  • Yes, search was setup over a week ago, with a full crawl daily and continuous crawl configured as well. This is just list content, with no approval settings. It is marked to be included in Search Results. Biggest question is why would I get results in Test Query but not in results from the web part? I think that the above issues would prevent the test query from returning any results.
    – Sean M
    Commented Dec 3, 2014 at 18:33

2 Answers 2

0

This appears to be a js conflict issue. One of my designers had added a js script in the custom Master Page, when he was trying to add some new functionality that he never got working.

<script src="//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js" type="text/javascript"></script>

Removing this reference fixed the issue.

0

We need to enable a feature SearchDrivenContentFeatureId Feature id : 592ccb4a-9304-49ab-aab1-66638198bb58
You can run below acript to do the same but make sure you have SharePoint management shell and SharePoint online SDK is pre installed


#

Script that enables a feature in a SPO Site

Required Parameters:

-> $sUserName: User Name to connect to the SharePoint Online Site Collection.

-> $sPassword: Password for the user.

-> $sSiteColUrl: SharePoint Online Site Collection

-> $sFeatureGuid: GUID of the feature to be enabled

#

$host.Runspace.ThreadOptions = "ReuseThread"

Definition of the function that allows to enable a SPO Feature

function Enable-SPOFeature { param ($sSiteColUrl,$sUserName,$sPassword,$sFeatureGuid) try {
#Adding the Client OM Assemblies
Add-Type -Path "\Microsoft.SharePoint.Client.dll" Add-Type -Path "\Microsoft.SharePoint.Client.Runtime.dll"

    #SPO Client Object Model Context
    $spoCtx = New-Object Microsoft.SharePoint.Client.ClientContext($sSiteColUrl) 
    $spoCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($sUsername, $sPassword)  
    $spoCtx.Credentials = $spoCredentials      

    Write-Host "----------------------------------------------------------------------------"  -foregroundcolor Green
    Write-Host "Enabling the Feature with GUID $sFeatureGuid !!" -ForegroundColor Green
    Write-Host "----------------------------------------------------------------------------"  -foregroundcolor Green

    $guiFeatureGuid = [System.Guid] $sFeatureGuid
    $spoSite=$spoCtx.Site
    $spoSite.Features.Add($sFeatureGuid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None)
    $spoCtx.ExecuteQuery()
    $spoCtx.Dispose()
}
catch [System.Exception]
{
    write-host -f red $_.Exception.ToString()   
}    

}

Required Parameters

$sSiteColUrl = "https://.sharepoint.com/" $sUserName = "@.onmicrosoft.com" $sFeatureGuid= "592ccb4a-9304-49ab-aab1-66638198bb58"

$sPassword = Read-Host -Prompt "Enter your password: " -AsSecureString

$sPassword=convertto-securestring "" -asplaintext -force

Enable-SPOFeature -sSiteColUrl $sSiteColUrl -sUserName $sUserName -sPassword $sPassword -sFeatureGuid $sFeatureGuid

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.