File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -938,7 +938,6 @@ def list_indexes(cls):
938
938
classes = []
939
939
940
940
def get_classes (cls ):
941
-
942
941
if cls not in classes and isinstance (cls , TopLevelDocumentMetaclass ):
943
942
classes .append (cls )
944
943
@@ -965,7 +964,7 @@ def get_classes(cls):
965
964
966
965
get_classes (cls )
967
966
968
- # get the indexes spec for all of the gathered classes
967
+ # get the indexes spec for all the gathered classes
969
968
def get_indexes_spec (cls ):
970
969
indexes = []
971
970
@@ -1000,8 +999,10 @@ def compare_indexes(cls):
1000
999
required = cls .list_indexes ()
1001
1000
1002
1001
existing = []
1003
- for info in cls ._get_collection ().index_information ().values ():
1002
+ collection = cls ._get_collection ()
1003
+ for info in collection .index_information ().values ():
1004
1004
if "_fts" in info ["key" ][0 ]:
1005
+ # Useful for text indexes (but not only)
1005
1006
index_type = info ["key" ][0 ][1 ]
1006
1007
text_index_fields = info .get ("weights" ).keys ()
1007
1008
existing .append ([(key , index_type ) for key in text_index_fields ])
You can’t perform that action at this time.
0 commit comments