@@ -1694,96 +1694,6 @@ func _assert_geosearch_result(result *redis.FTSearchResult, expectedDocIDs []str
16941694 Expect (result .Total ).To (BeEquivalentTo (len (expectedDocIDs )))
16951695}
16961696
1697- // It("should FTProfile Search and Aggregate", Label("search", "ftprofile"), func() {
1698- // val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{}, &redis.FieldSchema{FieldName: "t", FieldType: redis.SearchFieldTypeText}).Result()
1699- // Expect(err).NotTo(HaveOccurred())
1700- // Expect(val).To(BeEquivalentTo("OK"))
1701- // WaitForIndexing(client, "idx1")
1702-
1703- // client.HSet(ctx, "1", "t", "hello")
1704- // client.HSet(ctx, "2", "t", "world")
1705-
1706- // // FTProfile Search
1707- // query := redis.FTSearchQuery("hello|world", &redis.FTSearchOptions{NoContent: true})
1708- // res1, err := client.FTProfile(ctx, "idx1", false, query).Result()
1709- // Expect(err).NotTo(HaveOccurred())
1710- // panic(res1)
1711- // Expect(len(res1["results"].([]interface{}))).To(BeEquivalentTo(3))
1712- // resProfile := res1["profile"].(map[interface{}]interface{})
1713- // Expect(resProfile["Parsing time"].(float64) < 0.5).To(BeTrue())
1714- // iterProfile0 := resProfile["Iterators profile"].([]interface{})[0].(map[interface{}]interface{})
1715- // Expect(iterProfile0["Counter"]).To(BeEquivalentTo(2.0))
1716- // Expect(iterProfile0["Type"]).To(BeEquivalentTo("UNION"))
1717-
1718- // // FTProfile Aggregate
1719- // aggQuery := redis.FTAggregateQuery("*", &redis.FTAggregateOptions{
1720- // Load: []redis.FTAggregateLoad{{Field: "t"}},
1721- // Apply: []redis.FTAggregateApply{{Field: "startswith(@t, 'hel')", As: "prefix"}}})
1722- // res2, err := client.FTProfile(ctx, "idx1", false, aggQuery).Result()
1723- // Expect(err).NotTo(HaveOccurred())
1724- // Expect(len(res2["results"].([]interface{}))).To(BeEquivalentTo(2))
1725- // resProfile = res2["profile"].(map[interface{}]interface{})
1726- // iterProfile0 = resProfile["Iterators profile"].([]interface{})[0].(map[interface{}]interface{})
1727- // Expect(iterProfile0["Counter"]).To(BeEquivalentTo(2))
1728- // Expect(iterProfile0["Type"]).To(BeEquivalentTo("WILDCARD"))
1729- // })
1730-
1731- // It("should FTProfile Search Limited", Label("search", "ftprofile"), func() {
1732- // val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{}, &redis.FieldSchema{FieldName: "t", FieldType: redis.SearchFieldTypeText}).Result()
1733- // Expect(err).NotTo(HaveOccurred())
1734- // Expect(val).To(BeEquivalentTo("OK"))
1735- // WaitForIndexing(client, "idx1")
1736-
1737- // client.HSet(ctx, "1", "t", "hello")
1738- // client.HSet(ctx, "2", "t", "hell")
1739- // client.HSet(ctx, "3", "t", "help")
1740- // client.HSet(ctx, "4", "t", "helowa")
1741-
1742- // // FTProfile Search
1743- // query := redis.FTSearchQuery("%hell% hel*", &redis.FTSearchOptions{})
1744- // res1, err := client.FTProfile(ctx, "idx1", true, query).Result()
1745- // Expect(err).NotTo(HaveOccurred())
1746- // resProfile := res1["profile"].(map[interface{}]interface{})
1747- // iterProfile0 := resProfile["Iterators profile"].([]interface{})[0].(map[interface{}]interface{})
1748- // Expect(iterProfile0["Type"]).To(BeEquivalentTo("INTERSECT"))
1749- // Expect(len(res1["results"].([]interface{}))).To(BeEquivalentTo(3))
1750- // Expect(iterProfile0["Child iterators"].([]interface{})[0].(map[interface{}]interface{})["Child iterators"]).To(BeEquivalentTo("The number of iterators in the union is 3"))
1751- // Expect(iterProfile0["Child iterators"].([]interface{})[1].(map[interface{}]interface{})["Child iterators"]).To(BeEquivalentTo("The number of iterators in the union is 4"))
1752- // })
1753-
1754- // It("should FTProfile Search query params", Label("search", "ftprofile"), func() {
1755- // hnswOptions := &redis.FTHNSWOptions{Type: "FLOAT32", Dim: 2, DistanceMetric: "L2"}
1756- // val, err := client.FTCreate(ctx, "idx1",
1757- // &redis.FTCreateOptions{},
1758- // &redis.FieldSchema{FieldName: "v", FieldType: redis.SearchFieldTypeVector, VectorArgs: &redis.FTVectorArgs{HNSWOptions: hnswOptions}}).Result()
1759- // Expect(err).NotTo(HaveOccurred())
1760- // Expect(val).To(BeEquivalentTo("OK"))
1761- // WaitForIndexing(client, "idx1")
1762-
1763- // client.HSet(ctx, "a", "v", "aaaaaaaa")
1764- // client.HSet(ctx, "b", "v", "aaaabaaa")
1765- // client.HSet(ctx, "c", "v", "aaaaabaa")
1766-
1767- // // FTProfile Search
1768- // searchOptions := &redis.FTSearchOptions{
1769- // Return: []redis.FTSearchReturn{{FieldName: "__v_score"}},
1770- // SortBy: []redis.FTSearchSortBy{{FieldName: "__v_score", Asc: true}},
1771- // DialectVersion: 2,
1772- // Params: map[string]interface{}{"vec": "aaaaaaaa"},
1773- // }
1774- // query := redis.FTSearchQuery("*=>[KNN 2 @v $vec]", searchOptions)
1775- // res1, err := client.FTProfile(ctx, "idx1", false, query).Result()
1776- // Expect(err).NotTo(HaveOccurred())
1777- // resProfile := res1["profile"].(map[interface{}]interface{})
1778- // iterProfile0 := resProfile["Iterators profile"].([]interface{})[0].(map[interface{}]interface{})
1779- // Expect(iterProfile0["Counter"]).To(BeEquivalentTo(2))
1780- // Expect(iterProfile0["Type"]).To(BeEquivalentTo(redis.SearchFieldTypeVector.String()))
1781- // Expect(res1["total_results"]).To(BeEquivalentTo(2))
1782- // results0 := res1["results"].([]interface{})[0].(map[interface{}]interface{})
1783- // Expect(results0["id"]).To(BeEquivalentTo("a"))
1784- // Expect(results0["extra_attributes"].(map[interface{}]interface{})["__v_score"]).To(BeEquivalentTo("0"))
1785- // })
1786-
17871697var _ = Describe ("RediSearch FT.Config with Resp2 and Resp3" , Label ("search" , "NonRedisEnterprise" ), func () {
17881698
17891699 var clientResp2 * redis.Client
0 commit comments