1

My Local Xdb consists of only 4 Docs, By Using Sitecore.XConnectSearchIndexer.exe -rr command, I already rebuild my xdb index. But I am unable to get all data in Solr.

enter image description here

enter image description here

3
  • As per your information, your xDB only have 4 docs and in Solr it is showing 4 records. So what is the issue you are actually facing? Jul 20, 2023 at 15:08
  • Do you have any identified contacts in xDB or they are all anonymous? Please note that indexing of anonymous contacts is disabled by default for performance reasons. doc.sitecore.com/xp/en/developers/103/…
    – Anna Gevel
    Jul 20, 2023 at 15:09
  • xDB has more records, but in solr it’s only showing 4 Docs. Jul 20, 2023 at 16:54

1 Answer 1

0

It looks like you have zero contacts in your xDB index.

The docs that you are seeing in those screen shots are default ones that are used to manage the index (for example - when a rebuild is triggered).

An actual xDB contact record would begin more like this:

{
        "id":"a2db255477a60200000006a1b996f809",
        "contactid_s":"be3fb5f989fb000000000683c1c2fe36",
        "facets.profilescores.lastmodified_dt":"2023-02-08T10:28:38.016Z",
        "facets.ipinfo.lastmodified_dt":"2023-02-08T10:28:38.016Z",
        "facets.webvisit.screen.screenheight_i":480,
        "engagementvalue_i":0,
        "lastmodified_dt":"2023-02-08T10:28:38.016Z",
        "duration.hours_i":0,
        .....
}

As mentioned in the comments, your problem is most likely due to having no known contacts in xDB.

When a contact is first created, they are assigned two annonymous identifiers xDB.Tracker and Alias, which have ContactIdentifierType.Anonymous (stored in DB as '0').

When a contact is identified (you must do this in code using IdentifyAs() method), you assign a new identifier which has ContactIdentifierType.Known (stored in DB as '1').

To confirm this, try running this SQL command against your xDB tables:

SELECT A.ContactId
FROM [Your_Xdb.Collection.Shard0].[xdb_collection].[ContactIdentifiers] A
INNER JOIN  [Your_Xdb.Collection.Shard0].[xdb_collection].Contacts B ON A.ContactId=B.ContactId
where IdentifierType=1

UNION

SELECT A.ContactId
FROM [Your_Xdb.Collection.Shard1].[xdb_collection].[ContactIdentifiers] A
INNER JOIN  [Your_Xdb.Collection.Shard1].[xdb_collection].Contacts B ON A.ContactId=B.ContactId
where IdentifierType=1

Note: Dont ever run SQL queries directly against xDB tables in a production environment.

I am guessing it will return 0 contacts.

You can switch over the config in your search indexer to index annonymous contacts by updating: <your-xdb>\App_Data\jobs\continuous\IndexWorker\App_Data\Config\Sitecore\SearchIndexer\sc.Xdb.Collection.IndexerSettings.xml

Update this line to true:

<IndexAnonymousContactData>false</IndexAnonymousContactData>

Then click off a new rebuild using Sitecore.XConnectSearchIndexer.exe -rr

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.