This may be happening because by default Xonnect is not index anonymous contacts. You can enable anonymous contacts to be indexed as blow.
1) Set IndexAnonymousContactData setting in sc.Xdb.Collection.IndexerSettings.xml file to true. File can be found in the following path in the XConnect website.
2) Rebuild the XDB search index in SOLAR by running the “XConnectSearchIndexer -rr” command in command prompt inside “App_Data\jobs\continuous\IndexWorker” path
in XConnect website.