You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ppr_index.doc_typeclassRubricPageDocument(DocType):
sections=fields.NestedField(properties={
'blocks': fields.NestedField(properties={
'content': fields.StringField(),
'file_url': fields.StringField(),
'pdf_content': fields.StringField(),
'pk': fields.IntegerField(),
'title': fields.StringField(),
}),
'content': fields.StringField(),
'pk': fields.IntegerField(),
'title': fields.StringField(),
})
branch=fields.NestedField(properties={
'pk': fields.IntegerField(),
'name': fields.StringField(),
})
classMeta:
model=RubricPage# The fields of the model to be indexed in Elasticsearchfields= [
'title',
]
# Ensure the rubric index is upated when a section or a branch is updatedrelated_models= [BlockSectionRubricPage, SectionRubricPage]
defget_instances_from_related(self, related_instance):
""" Define how to retrieve a RubricPage instance from a SectionRubricPage or a BlockSectionRubricPage """ifisinstance(related_instance, SectionRubricPage):
returnrelated_instance.rubricpage_set.all()
elifisinstance(related_instance, BlockSectionRubricPage):
returnRubricPage.objects.filter(sections__blocks__pk=related_instance.pk)
elifisinstance(related_instance, Branch):
returnRubricPage.objects.filter(branch__pk=related_instance.pk)
The problem is when I try to search the index with this code:
Hi,
I am trying to make a migration from ES 5.6.4 to 6.5.4.
I currently use
I have a model like this:
And a Document like this
The problem is when I try to search the index with this code:
I get a 400 error from ElasticSearch.
The ES error:
Basicaly, my sections property seems not to be recognized a nested by ES and when I check the ES schema, I get this:
Where the
"type": "nested"
is indeed missing for the Many to Many fields.Any clue what's going on ?
Thanks :)
The text was updated successfully, but these errors were encountered: