0

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"
}
Tedford
  • 2,842
  • 2
  • 35
  • 45
  • 1
    Some clarifying questions: 1. Is this a MongoDB account by any chance? Currently, Azure Search only supports "classis" Cosmos DB collections. 2. Azure Search import wizard looks at the first document in the collection when detecting the schema. Does the first document in the collection have any fields other than "id"? How many documents are there in the collection? – Eugene Shvets Dec 06 '17 at 19:23
  • Yes the cosmosdb was indeed setup as MongoDB API. The first document was fully populated, others are sparse but the first was full; however, given your first question that would seem to be my problem. Finally there are 6k documents in the collection. Basically just a test bed to make for interesting queries. If you want to state your #1 as an answer I will accept it. – Tedford Dec 06 '17 at 20:00

1 Answers1

3

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.

Eugene Shvets
  • 4,561
  • 13
  • 19