| 35 | static auto Parse(const std::string& in) { return sql::ParseToIR(peg::string_input(in, "test")); } |
| 36 | |
| 37 | static IndexMap MakeIndexMap() { |
| 38 | auto f1 = FieldInfo("f1", std::make_unique<redis::TagFieldMetadata>()); |
| 39 | auto f2 = FieldInfo("f2", std::make_unique<redis::NumericFieldMetadata>()); |
| 40 | auto f3 = FieldInfo("f3", std::make_unique<redis::NumericFieldMetadata>()); |
| 41 | |
| 42 | auto hnsw_field_meta = std::make_unique<redis::HnswVectorFieldMetadata>(); |
| 43 | hnsw_field_meta->vector_type = redis::VectorType::FLOAT64; |
| 44 | hnsw_field_meta->dim = 3; |
| 45 | hnsw_field_meta->distance_metric = redis::DistanceMetric::L2; |
| 46 | auto f4 = FieldInfo("f4", std::move(hnsw_field_meta)); |
| 47 | |
| 48 | hnsw_field_meta = std::make_unique<redis::HnswVectorFieldMetadata>(); |
| 49 | hnsw_field_meta->vector_type = redis::VectorType::FLOAT64; |
| 50 | hnsw_field_meta->dim = 3; |
| 51 | hnsw_field_meta->distance_metric = redis::DistanceMetric::COSINE; |
| 52 | auto f5 = FieldInfo("f5", std::move(hnsw_field_meta)); |
| 53 | f5.metadata->noindex = true; |
| 54 | |
| 55 | auto ia = std::make_unique<IndexInfo>("ia", redis::IndexMetadata(), ""); |
| 56 | ia->Add(std::move(f1)); |
| 57 | ia->Add(std::move(f2)); |
| 58 | ia->Add(std::move(f3)); |
| 59 | ia->Add(std::move(f4)); |
| 60 | ia->Add(std::move(f5)); |
| 61 | |
| 62 | IndexMap res; |
| 63 | res.Insert(std::move(ia)); |
| 64 | return res; |
| 65 | } |
| 66 | |
| 67 | using testing::MatchesRegex; |
| 68 |
no test coverage detected