Skip to content

Commit 6038694

Browse files
author
Marcin Kardas
committed
Fix mapping type name
Due to previous mismatch between version of elastic search instance (6.7.1) and elasticsearch-dsl version (7.0.0) and the fact that saving a document in non-existent index creates an index inferred from the document, there's a mismatch between mapping type name. This commit makes it possible to downgrade elasticsearch-dsl to version compatible with elastic search 6.7.1 without a need for recreating the indexes.
1 parent 6489719 commit 6038694

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sota_extractor2/data/elastic.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ class Fragment(Document):
108108
)
109109
outer_headers = Text(analyzer=html_strip, )
110110

111+
class Meta:
112+
doc_type = '_doc'
113+
111114
class Index:
115+
doc_type = '_doc'
112116
name = 'paper-fragments'
113117

114118
@classmethod
@@ -138,7 +142,11 @@ class Paper(Document):
138142
analyzer=html_strip
139143
)
140144

145+
class Meta:
146+
doc_type = '_doc'
147+
141148
class Index:
149+
doc_type = '_doc'
142150
name = 'papers'
143151

144152
def to_json(self):
@@ -290,7 +298,11 @@ class Reference(Document):
290298
urls = Keyword()
291299
is_ml = Boolean()
292300

301+
class Meta:
302+
doc_type = '_doc'
303+
293304
class Index:
305+
doc_type = '_doc'
294306
name = 'references'
295307

296308
def __repr__(self):
@@ -317,7 +329,11 @@ class Reference2(Document):
317329
pwc_slug = Keyword()
318330
orig_refs = Text()
319331

332+
class Meta:
333+
doc_type = '_doc'
334+
320335
class Index:
336+
doc_type = '_doc'
321337
name = 'references2'
322338

323339
def add_ref(self, ref):

0 commit comments

Comments
 (0)