Search code examples
azureazure-cosmosdbazure-cognitive-search

No fields beyond id found when importing into Azure Search from CosmosDB


I am attempting to import data into azure search from cosmosdb and the import wizard does not detect any fields beyond id. If I import from Azure Table or the Sample data set then the import works as expected. Is there something I am overlooking, such as a required set of fields on my document in cosmos?

Import Query

SELECT c.id, c.first, c.last, c.address, c.city, c.state, c.zip, c.dob, c.sex, c._ts from c where c._ts > @HighWaterMark order by c._ts

Cosmos Document

{
    "_id" : "1d202fb9-f384-42f4-a5f8-bf729b776576",
    "first" : "Mata",
    "middle" : "Hari",
    "last" : "Drentlaw",
    "address" : "3226 16TH ST",
    "city" : "QUEENS",
    "state" : "PA",
    "zip" : "10465",
    "sex" : "O",
    "dob" : "1984/03/01",
    "dod" : null,
    "language" : "HiriMotu",
    "ssn" : "123456789",
    "ethnicity" : "Asturian",
    "ethnicityCode" : "2139-4",
    "phone" : "1-555-867-5309",
    "maritalStatus" : "Married",
    "martialStatusCode" : "M",
    "race" : "Georgetown"
}

Solution

  • Turned out this was a Mongo DB collection. Currently, Azure Search indexer only supports "classic" Cosmos DB collections. We're working on adding support for Mongo DB. To help us prioritize that work and get status updates, please vote for DocumentDB indexer should be able to index MongoDb collections UserVoice suggestion.