Skip to content

Commit 10185ab

Browse files
committed
stubed up method
1 parent 69e1c23 commit 10185ab

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
@@ -6,7 +6,7 @@
66
from django.db.models.sql.query import Query
77
from django.db.models.sql.where import AND, XOR, WhereNode
88
from pymongo import ASCENDING, DESCENDING
9-
from pymongo.operations import IndexModel
9+
from pymongo.operations import IndexModel, SearchIndexModel
1010

1111
from .query_utils import process_rhs
1212

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

143143

144+
class AtlasSearchIndex(Index):
145+
def __init__(self, *expressions, **kwargs):
146+
super().__init__(*expressions, **kwargs)
147+
148+
def create_mongodb_index(
149+
self, model, schema_editor, field=None, unique=False, column_prefix=""
150+
):
151+
return SearchIndexModel(
152+
definitions={},
153+
)
154+
155+
144156
def register_indexes():
145157
BuiltinLookup.as_mql_idx = builtin_lookup_idx
146158
Index._get_condition_mql = _get_condition_mql

0 commit comments

Comments
 (0)