mirror of
https://github.com/redis/go-redis.git
synced 2025-07-25 08:21:55 +03:00
drop ft.profile that was never enabled (#3323)
This commit is contained in:
@ -1694,96 +1694,6 @@ func _assert_geosearch_result(result *redis.FTSearchResult, expectedDocIDs []str
|
||||
Expect(result.Total).To(BeEquivalentTo(len(expectedDocIDs)))
|
||||
}
|
||||
|
||||
// It("should FTProfile Search and Aggregate", Label("search", "ftprofile"), func() {
|
||||
// val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{}, &redis.FieldSchema{FieldName: "t", FieldType: redis.SearchFieldTypeText}).Result()
|
||||
// Expect(err).NotTo(HaveOccurred())
|
||||
// Expect(val).To(BeEquivalentTo("OK"))
|
||||
// WaitForIndexing(client, "idx1")
|
||||
|
||||
// client.HSet(ctx, "1", "t", "hello")
|
||||
// client.HSet(ctx, "2", "t", "world")
|
||||
|
||||
// // FTProfile Search
|
||||
// query := redis.FTSearchQuery("hello|world", &redis.FTSearchOptions{NoContent: true})
|
||||
// res1, err := client.FTProfile(ctx, "idx1", false, query).Result()
|
||||
// Expect(err).NotTo(HaveOccurred())
|
||||
// panic(res1)
|
||||
// Expect(len(res1["results"].([]interface{}))).To(BeEquivalentTo(3))
|
||||
// resProfile := res1["profile"].(map[interface{}]interface{})
|
||||
// Expect(resProfile["Parsing time"].(float64) < 0.5).To(BeTrue())
|
||||
// iterProfile0 := resProfile["Iterators profile"].([]interface{})[0].(map[interface{}]interface{})
|
||||
// Expect(iterProfile0["Counter"]).To(BeEquivalentTo(2.0))
|
||||
// Expect(iterProfile0["Type"]).To(BeEquivalentTo("UNION"))
|
||||
|
||||
// // FTProfile Aggregate
|
||||
// aggQuery := redis.FTAggregateQuery("*", &redis.FTAggregateOptions{
|
||||
// Load: []redis.FTAggregateLoad{{Field: "t"}},
|
||||
// Apply: []redis.FTAggregateApply{{Field: "startswith(@t, 'hel')", As: "prefix"}}})
|
||||
// res2, err := client.FTProfile(ctx, "idx1", false, aggQuery).Result()
|
||||
// Expect(err).NotTo(HaveOccurred())
|
||||
// Expect(len(res2["results"].([]interface{}))).To(BeEquivalentTo(2))
|
||||
// resProfile = res2["profile"].(map[interface{}]interface{})
|
||||
// iterProfile0 = resProfile["Iterators profile"].([]interface{})[0].(map[interface{}]interface{})
|
||||
// Expect(iterProfile0["Counter"]).To(BeEquivalentTo(2))
|
||||
// Expect(iterProfile0["Type"]).To(BeEquivalentTo("WILDCARD"))
|
||||
// })
|
||||
|
||||
// It("should FTProfile Search Limited", Label("search", "ftprofile"), func() {
|
||||
// val, err := client.FTCreate(ctx, "idx1", &redis.FTCreateOptions{}, &redis.FieldSchema{FieldName: "t", FieldType: redis.SearchFieldTypeText}).Result()
|
||||
// Expect(err).NotTo(HaveOccurred())
|
||||
// Expect(val).To(BeEquivalentTo("OK"))
|
||||
// WaitForIndexing(client, "idx1")
|
||||
|
||||
// client.HSet(ctx, "1", "t", "hello")
|
||||
// client.HSet(ctx, "2", "t", "hell")
|
||||
// client.HSet(ctx, "3", "t", "help")
|
||||
// client.HSet(ctx, "4", "t", "helowa")
|
||||
|
||||
// // FTProfile Search
|
||||
// query := redis.FTSearchQuery("%hell% hel*", &redis.FTSearchOptions{})
|
||||
// res1, err := client.FTProfile(ctx, "idx1", true, query).Result()
|
||||
// Expect(err).NotTo(HaveOccurred())
|
||||
// resProfile := res1["profile"].(map[interface{}]interface{})
|
||||
// iterProfile0 := resProfile["Iterators profile"].([]interface{})[0].(map[interface{}]interface{})
|
||||
// Expect(iterProfile0["Type"]).To(BeEquivalentTo("INTERSECT"))
|
||||
// Expect(len(res1["results"].([]interface{}))).To(BeEquivalentTo(3))
|
||||
// Expect(iterProfile0["Child iterators"].([]interface{})[0].(map[interface{}]interface{})["Child iterators"]).To(BeEquivalentTo("The number of iterators in the union is 3"))
|
||||
// Expect(iterProfile0["Child iterators"].([]interface{})[1].(map[interface{}]interface{})["Child iterators"]).To(BeEquivalentTo("The number of iterators in the union is 4"))
|
||||
// })
|
||||
|
||||
// It("should FTProfile Search query params", Label("search", "ftprofile"), func() {
|
||||
// hnswOptions := &redis.FTHNSWOptions{Type: "FLOAT32", Dim: 2, DistanceMetric: "L2"}
|
||||
// val, err := client.FTCreate(ctx, "idx1",
|
||||
// &redis.FTCreateOptions{},
|
||||
// &redis.FieldSchema{FieldName: "v", FieldType: redis.SearchFieldTypeVector, VectorArgs: &redis.FTVectorArgs{HNSWOptions: hnswOptions}}).Result()
|
||||
// Expect(err).NotTo(HaveOccurred())
|
||||
// Expect(val).To(BeEquivalentTo("OK"))
|
||||
// WaitForIndexing(client, "idx1")
|
||||
|
||||
// client.HSet(ctx, "a", "v", "aaaaaaaa")
|
||||
// client.HSet(ctx, "b", "v", "aaaabaaa")
|
||||
// client.HSet(ctx, "c", "v", "aaaaabaa")
|
||||
|
||||
// // FTProfile Search
|
||||
// searchOptions := &redis.FTSearchOptions{
|
||||
// Return: []redis.FTSearchReturn{{FieldName: "__v_score"}},
|
||||
// SortBy: []redis.FTSearchSortBy{{FieldName: "__v_score", Asc: true}},
|
||||
// DialectVersion: 2,
|
||||
// Params: map[string]interface{}{"vec": "aaaaaaaa"},
|
||||
// }
|
||||
// query := redis.FTSearchQuery("*=>[KNN 2 @v $vec]", searchOptions)
|
||||
// res1, err := client.FTProfile(ctx, "idx1", false, query).Result()
|
||||
// Expect(err).NotTo(HaveOccurred())
|
||||
// resProfile := res1["profile"].(map[interface{}]interface{})
|
||||
// iterProfile0 := resProfile["Iterators profile"].([]interface{})[0].(map[interface{}]interface{})
|
||||
// Expect(iterProfile0["Counter"]).To(BeEquivalentTo(2))
|
||||
// Expect(iterProfile0["Type"]).To(BeEquivalentTo(redis.SearchFieldTypeVector.String()))
|
||||
// Expect(res1["total_results"]).To(BeEquivalentTo(2))
|
||||
// results0 := res1["results"].([]interface{})[0].(map[interface{}]interface{})
|
||||
// Expect(results0["id"]).To(BeEquivalentTo("a"))
|
||||
// Expect(results0["extra_attributes"].(map[interface{}]interface{})["__v_score"]).To(BeEquivalentTo("0"))
|
||||
// })
|
||||
|
||||
var _ = Describe("RediSearch FT.Config with Resp2 and Resp3", Label("search", "NonRedisEnterprise"), func() {
|
||||
|
||||
var clientResp2 *redis.Client
|
||||
|
Reference in New Issue
Block a user