Closed joaovbsevero closed 1 year ago
Milvus has indices that need further parametrization. We'll need to either generalize these fields or allow for specialization via inheritance with MilvusIndex/MongoIndex etc.
Don't we already have a metaclass-based solution for number 3's inheritance problem? What do we gain by going with number 3 over number 2? I'm asking this, because number 2 would solve a few other "parametrization" problems (dimensionality of float vectors, is_primary_key, auto incrementers, date fields, hash fields, etc.).
Milvus has indices that need further parametrization. We'll need to either generalize these fields or allow for specialization via inheritance with MilvusIndex/MongoIndex etc.
Specialization would break the "single inheritance" from the user point of view that was really hard to achieve
Don't we already have a metaclass-based solution for number 3's inheritance problem? What do we gain by going with number 3 over number 2? I'm asking this, because number 2 would solve a few other "parametrization" problems (dimensionality of float vectors, is_primary_key, auto incrementers, date fields, hash fields, etc.).
Number 3 provides more flexibility over what the indice can be, if the user wants to define multiple columns for the same indice, fine, the user wants to create two indices for the same column, fine, whereas number 2 can restrict some possibilities for the users (such as the two examples provided).
Side note, number 1 is the same as number 3 but less elegant
This issue will discuss some possibilities to allow the creation of indices in the child classes of Document.
Given a indice structure like:
Users would use it like:
Given a field structure like:
Users would use it like:
Where the presence of the "unique" keyword makes it a indice
Given a config structure like:
Users would use it like:
Some notes regarding these approaches: