Azure-sdk-for-net: [BUG] Azure Search Issue when trying to merge different Cosmos DB documents (with aggregation) into one index with GROUP BY operation

Created on 30 Sep 2020  路  7Comments  路  Source: Azure/azure-sdk-for-net

Describe the bug
When I trying to create an Index through Azure.Search.Documents v.11 SDK with different data sources in my case it's just two separate Cosmos DB documents (tables). After I create the Index I am going to create a data source and indexer for the first document everything went well and it attached to the index successfully but when I am trying to create and attach the second data source to the index and in conclusion merge it to one index document it returns an error for me.

What actually I need as result?
_Indexer that can use Cosmos SQL query with aggregation!_

image

select Sum(udf.reactionCount(r.content)), r.registri from recenzoj r
group by r.registri
function reactionCount(c){
    switch(c.reaction){
        case "Inspiring": return 1;
        case "Cool": return 1;
        case "LoveIt": return 1; 
        case "Gripping": return 1;
        case "Boring": return -1;
        case "Sad" : return -1;
        default: return 0;
    }
}

Expected behavior
As a result, I want one Index which will contain two different data sources.

Actual behavior (include Exception or Stack Trace)
When I am trying to create a second indexer and attach it to Index I get this error.
image

Following sql which I am trying to run is here:

select Sum(udf.reactionCount(r.content)), r.registri from recenzoj r
group by r.registri

UDF which used in function:

function reactionCount(c){
    switch(c.reaction){
        case "Inspiring": return 1;
        case "Cool": return 1;
        case "LoveIt": return 1; 
        case "Gripping": return 1;
        case "Boring": return -1;
        case "Sad" : return -1;
        default: return 0;
    }
}

Environment:

  • Name and version of the Library package used: [e.g. Azure.Search.Documents 11.1.0]
Client Search Service Attention customer-reported needs-team-attention question

All 7 comments

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Wmengmsft, @MehaKaushik, @shurd

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Wmengmsft, @MehaKaushik, @shurd.

Thank you for your feedback. Tagging and routing to the team best able to assist.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @brjohnstmsft, @bleroy, @tjacobhi, @markheff, @miwelsh.

@OlegLviv - I apologize for the delay on this. This looks like more of a product question than an SDK issue. Are you still blocked on this?

@OlegLviv - I did a bit more research on this and unfortunately using GROUP By in a data source query is an unsupported scenario for Azure Cognitive Search. Cosmos DB doesn't support continuation tokens for group bys because they can get too large. In turn, we're not able to properly index the data when there is a group by expression.

@dereklegenzoff ok thx so now you can close this issue as I found another more comfortable approach for my business case.

Was this page helpful?
0 / 5 - 0 ratings