Ever have one of those error messages that return less than a dozen results in Google? Makes you feel pretty alone. Sorry, this is not a therapy session. Let’s get you right as rain.

https://i.imgflip.com/2eagcd.jpg
What’s really going to flip your biscuit…

The full text of the message is as follows:

{
  "responseHeader":{
    "zkConnected":true,
    "status":400,
    "QTime":0,
    "params":{
      "q":"id:xdb-rebuild-status",
      "fl":"*,[child limit=1024]",
      "wt":"json"}},
  "error":{
    "metadata":[
      "error-class","org.apache.solr.common.SolrException",
      "root-error-class","org.apache.solr.common.SolrException"],
    "msg":"Parent filter should be sent as parentFilter=filterCondition",
    "code":400}
}
 

Like every good error message, this one does literally nothing to help you along your way. Well, digging into the search results from google, it’s fairly easy to see that parentFilter is something to do with the nested document capabilities. That capability utilizes the “_nest_path_” field, which you’re probably missing. How? I have no idea how it happened. But, if you check your schema fields, you’ll notice it’s missing:

So yeah, that would make sense! How do you fix it? Well, if you’re using regular old Solr, it’s easy. It’s a simple managed-schema update! See this SO for some info: https://sitecore.stackexchange.com/questions/23928/xconnect-indexworker-solr-error-parentfilter-filterconditionhttps://sitecore.stackexchange.com/questions/23928/xconnect-indexworker-solr-error-parentfilter-filtercondition Now, if you’re using SolrCloud, things are a little more difficult. Turns out your managed-schema is managed by Zookeeper which in turn, ingests all that goodness. You actually need to be updating your managed-schema through the API. It’s a little daunting, but here’s the basics:

  1. You need to create a JSON file of all actions that the update should include.
  2. You need to post that JSON to the API.

First, we’ll need to add the field type to the solr schema. Note the specific “class” below:

"add-field-type": {
    "name": "_nest_path_",
    "class": "solr.NestPathField",
    "positionIncrementGap": "100",
    "omitTermFreqAndPositions": true,
    "omitNorms": true,
    "maxCharsForDocValues": "-1",
    "stored": false
}

Then we need to add the field itself:

"add-field": [
        {
            "name": "_nest_path_",
            "type": "_nest_path_"
        }
]

Put together, it looks like this:

{
    "add-field-type": [
        {
            "name": "_nest_path_",
            "class": "solr.NestPathField",
            "positionIncrementGap": "100",
            "omitTermFreqAndPositions": true,
            "omitNorms": true,
            "maxCharsForDocValues": "-1",
            "stored": false
        }
    ]
    "add-field": [
        {
            "name": "_nest_path_",
            "type": "_nest_path_"
        }
    ]
}

Now we need to actually post that to solr. PowerShell to the rescue here. It’s not a long script:

$pathToXdbSchemaFile="<SCHEMA_CHANGES>.json"
$apiUrl="<SOLR>/solr/xdb_internal/schema"

$requestBody = Get-Content $pathToXdbSchemaFile -Raw | ConvertFrom-Json | ConvertTo-Json
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 

Invoke-WebRequest -Uri $apiUrl -ContentType "application/json" -Method Post -UseBasicParsing -Body $requestBody | ConvertFrom-Json | ConvertTo-Json

Once that’s completed, you should see a confirmation in the command prompt that it was successfully received:

After that, you’ll note your schema should have the new field:

Once this is done, you’ll want to kick off a reindex of xDB to ensure all is up to date with the new field.