Can you add a exclude_fields to class Elasticsearch to only exclude some fields?
I'm using abstract model. I have a lot of models have a uuid field (and other fields) which is useless for search. Its painfull to use fields to specify each model to exclude the uuid field.
My code like this:
class CommonAttr(models.Model):
create_date = models.DateTimeField(u"Create data", auto_now_add=True) # exclude
uuid = models.CharField(u'UUID', max_length=36, unique=True) # exclude
class Meta:
abstract = True
class Elasticsearch(EsIndexable.Elasticsearch):
exclude_fields = ['uuid', 'create_date'] # this is very usefull for abstract model
class A(CommonAttr):
pass
class B(CommonAttr):
pass
Can you add a exclude_fields to only exclude some fields?
Thank you very much.
Can you add a
exclude_fields
to class Elasticsearch to only exclude some fields?I'm using abstract model. I have a lot of models have a
uuid
field (and other fields) which is useless for search. Its painfull to usefields
to specify each model to exclude the uuid field.My code like this:
Can you add a
exclude_fields
to only exclude some fields? Thank you very much.