Upgrading code from Algolia.Search 5.3.1 to Algolia.Search 6.12.1

I’m trying to move a .net core 2.1 solution with a web api warrping our algolia indices, to a .net core 6 solution and I was upgrading also from Algolia.Search 5.3.1 to 6.12.1.
and my question is what is the alternative / replacment to the Query SetFilters method? as i have a the following code:

 StringBuilder sbFilters = new StringBuilder();
                string queryfilter = (lang == "he") ? "itemLang = 1037" : "itemLang = 1033";

                sbFilters.Append(queryfilter);                
                if (!string.IsNullOrEmpty(degreetype)) {
                    if (degreetype.Contains("-"))
                    {
                        var degreetypeIds = degreetype.Split("-");
                        for (int i = 0; i < degreetypeIds.Length; i++)
                        {
                            if(i == 0)
                            {
                                sbFilters.Append(" AND (");
                            }
                            sbFilters.Append("degreeTypeId = " + degreetypeIds[i]);
                            if(i >= 0 && i < degreetypeIds.Length - 1)
                            {
                                sbFilters.Append(" OR ");
                            }
                            if (i == degreetypeIds.Length -1)
                            {
                                sbFilters.Append(")");
                            }
                        }
                    }
                    else
                    {
                        sbFilters.Append(" AND degreeTypeId = " + degreetype);
                    }
                }

                if (!string.IsNullOrEmpty(faculty))
                {
                    if (faculty.Contains("-"))
                    {
                        var facultiesIds = faculty.Split("-");
                        for (int i = 0; i < facultiesIds.Length; i++)
                        {
                            if (i == 0)
                            {
                                sbFilters.Append(" AND (");
                            }
                            sbFilters.Append("schoolId = " + facultiesIds[i]);
                            if (i >= 0 && i < facultiesIds.Length - 1)
                            {
                                sbFilters.Append(" OR ");
                            }
                            if (i == facultiesIds.Length - 1)
                            {
                                sbFilters.Append(")");
                            }
                        }
                    }
                    else
                    {
                        sbFilters.Append(" AND schoolId = " + faculty);
                    }
                }

                if (!string.IsNullOrEmpty(itemtype))
                {
                    if (itemtype.Contains("-"))
                    {
                        var itemtypeIds = itemtype.Split("-");
                        for (int i = 0; i < itemtypeIds.Length; i++)
                        {
                            if (i == 0)
                            {
                                sbFilters.Append(" AND (");
                            }
                            sbFilters.Append("itemType = " + itemtypeIds[i]);
                            if (i >= 0 && i < itemtypeIds.Length - 1)
                            {
                                sbFilters.Append(" OR ");
                            }
                            if (i == itemtypeIds.Length - 1)
                            {
                                sbFilters.Append(")");
                            }
                        }
                    }
                    else
                    {
                        sbFilters.Append(" AND itemType = " + itemtype);
                    }
                }

 algoliaResults = index.Search(new Query(query).SetFilters(sbFilters.ToString())).ToObject<AlgoliaSearchResults>();

Looking forward to help and respond
Thank You.