Skip to content

Commit 97ca627

Browse files
committed
stubed up method
1 parent 87d9284 commit 97ca627

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

django_mongodb_backend/indexes.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from django.db.models.sql.query import Query
55
from django.db.models.sql.where import AND, XOR, WhereNode
66
from pymongo import ASCENDING, DESCENDING
7-
from pymongo.operations import IndexModel
7+
from pymongo.operations import IndexModel, SearchIndexModel
88

99
from .query_utils import process_rhs
1010

@@ -100,6 +100,18 @@ def create_mongodb_index(self, model, schema_editor, field=None, unique=False, c
100100
return IndexModel(index_orders, name=self.name, **kwargs)
101101

102102

103+
class AtlasSearchIndex(Index):
104+
def __init__(self, *expressions, **kwargs):
105+
super().__init__(*expressions, **kwargs)
106+
107+
def create_mongodb_index(
108+
self, model, schema_editor, field=None, unique=False, column_prefix=""
109+
):
110+
return SearchIndexModel(
111+
definitions={},
112+
)
113+
114+
103115
def register_indexes():
104116
BuiltinLookup.as_mql_idx = builtin_lookup_idx
105117
Index._get_condition_mql = _get_condition_mql

0 commit comments

Comments
 (0)