[skip ci] reproduce issue in (failing) acceptance test
@@ -1061,6 +1061,36 @@ func localMetaWithObjectLimit(t *testing.T) {
})
})
+ t.Run("with nearObject and high certainty (few results), high objectLimit", func(t *testing.T) {
+ result := AssertGraphQL(t, helper.RootAuth, `
+ {
+ Aggregate {
+ RansomNote(
+ nearText: {
+ concepts: ["abc"]
+ certainty: 0.7 # should return about 6 elements
+ }
+ objectLimit:100,
+ ) {
+ meta {
+ count
+ }
+ }
+ }
+ }
+ `)
+
+ t.Run("validate fewer than objectLimit elements are returned", func(t *testing.T) {
+ res := result.Get("Aggregate", "RansomNote").AsSlice()
+ require.Len(t, res, 1)
+ meta := res[0].(map[string]interface{})["meta"]
+ count := meta.(map[string]interface{})["count"]
+ countParsed, err := count.(json.Number).Int64()
+ require.Nil(t, err)
+ assert.Less(t, countParsed, int64(100))
+ })
+ })
+
t.Run("with nearText and no certainty, where filter and groupBy", func(t *testing.T) {
objectLimit := 1
result := AssertGraphQL(t, helper.RootAuth, fmt.Sprintf(`
