(self, client, dim=4)
| 4045 | _HYBRID_TIMEOUT_DOCS = 1500 |
| 4046 | |
| 4047 | def _create_hybrid_search_index(self, client, dim=4): |
| 4048 | client.ft().create_index( |
| 4049 | ( |
| 4050 | TextField("description"), |
| 4051 | NumericField("price"), |
| 4052 | TagField("color"), |
| 4053 | TagField("item_type"), |
| 4054 | NumericField("size"), |
| 4055 | VectorField( |
| 4056 | "embedding", |
| 4057 | "FLAT", |
| 4058 | { |
| 4059 | "TYPE": "FLOAT32", |
| 4060 | "DIM": dim, |
| 4061 | "DISTANCE_METRIC": "L2", |
| 4062 | }, |
| 4063 | ), |
| 4064 | VectorField( |
| 4065 | "embedding-hnsw", |
| 4066 | "HNSW", |
| 4067 | { |
| 4068 | "TYPE": "FLOAT32", |
| 4069 | "DIM": dim, |
| 4070 | "DISTANCE_METRIC": "L2", |
| 4071 | }, |
| 4072 | ), |
| 4073 | ), |
| 4074 | definition=IndexDefinition(prefix=["item:"]), |
| 4075 | ) |
| 4076 | SearchTestsBase.waitForIndex(client, "idx") |
| 4077 | |
| 4078 | def _create_hybrid_search_timeout_index(self, client): |
| 4079 | client.ft().create_index( |
no test coverage detected