-
Notifications
You must be signed in to change notification settings - Fork 10
Add field to DataField and DataConcept for excluding from search index #223
Conversation
@@ -135,6 +135,10 @@ class DataField(BasePlural, PublishArchiveMixin): | |||
# no full text data. | |||
enumerable = models.BooleanField(default=False) | |||
|
|||
# Set this field to False if you wish to exclude this field from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not exclude the field itself from the index, just the data values.
@@ -736,6 +740,10 @@ class DataConcept(BasePlural, PublishArchiveMixin): | |||
# represents. | |||
sortable = models.BooleanField(default=True) | |||
|
|||
# Set this field to False if you wish to exclude the data from all | |||
# DataFields associated with this conept from the Haystack index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conept => concept. And this is still not quite accurate, the fields themselves are being excluded not just their data.
de1df59
to
0d73c2c
Compare
@@ -736,6 +740,10 @@ class DataConcept(BasePlural, PublishArchiveMixin): | |||
# represents. | |||
sortable = models.BooleanField(default=True) | |||
|
|||
# Set this field to False if you wish to exclude DataFields and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit, but this is redundant "exclude the DataFields and the DataField's data associated with this concept". I think excluding the field itself implies the data won't be there either.
@@ -72,6 +72,7 @@ def get_heuristic_flags(field): | |||
# TextFields are typically used for free text | |||
return { | |||
'enumerable': is_enumerable(field), | |||
'indexable': is_enumerable(field) or is_searchable(field), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_enumerable
does hit the database, so it would be worth setting the result to a value from the first call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize is_searchable
also does.. but that refactor is out of scope here.
Signed-off-by: Don Naegely <naegelyd@gmail.com>
Add field to DataField and DataConcept for excluding from search index
Fix #172.
Signed-off-by: Don Naegely naegelyd@gmail.com