[BUG] Azure Search Issue when trying to merge different Cosmos DB documents (with aggregation) into one index with GROUP BY operation
See original GitHub issueDescribe 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!
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.
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]
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@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.
Thank you for your feedback. Tagging and routing to the team best able to assist.