1
votes

It's the first time that i'm using Azure Search. I follewed the example with the generated dataset. Now I want to implement Azure search on my database.

This is an example of an item of the collection I want to index.

{
"_id" : "Watch",
"name" : "Watch",
"cloudProvider" : "azure",
"channel" : "C6SELFQMD",
"services" : [
    "azure-backup",
    "azure-data-lake-analytics",
    "backup",
    "blobstorage",
    "site-recovery",
    "storage"
],
"__v" : 0

}

Azure search itself doesn't even detect the fields.

This are the steps i'm doing:

enter image description here

enter image description here

If I add the fields manually it returns useless data. Does somebody know why this is happening? I do only have 2 items in my collection at the moment but I don't think that this is the problem?

UPDATE: So the problem is that I've an underscore before my id ("_id"). Now I'm trying to use fieldMappings to solve this issue. But the api's response is:

{
    "error": {
        "code": "",
        "message": "Data source does not contain column '_id', which is required because it maps to the document key field 'id' in the index 'index'. Ensure that the '_id' column is present in the data source, or add a field mapping that maps one of the existing column names to 'id'."
    }
}
1
From the values ($t, $v etc.) it seems the data source is not a Cosmos DB account with DocumentDB API. Can you please check the API for the Cosmos DB account?Gaurav Mantri
I'm 100% sure that it runs on a Cosmos DB account with DocumentDB API. Could it be that this error triggers because there's i've a property "_id"? I think that the underscore is creating the issue.stef morren
Could it be that this error triggers because there's i've a property "_id" -> That is definitely true because the field name can't start with an underscore. Please see naming rules here: docs.microsoft.com/en-us/rest/api/searchservice/naming-rules. I made the comment because of $v, $t property though. I have seen those in Cosmos DB accounts with Table API.Gaurav Mantri
Updated starters topicstef morren
@stefmorren did you find the solution yet?ThieuND

1 Answers

3
votes

Azure Search currently does not support Cosmos DB Table API accounts, as seems to be the case here.

If you want to see Table API supported by Azure Search, please vote for Azure Search should be able to index Cosmos DB Table API collections to help us prioritize that work.