Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Add field to DataField and DataConcept for excluding from search index #223

Merged
merged 1 commit into from
Sep 19, 2014

Conversation

naegelyd
Copy link
Collaborator

Fix #172.

Signed-off-by: Don Naegely naegelyd@gmail.com

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) when pulling aa6160e on issue-172 into 0a6e6be on master.

@@ -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
Copy link
Contributor

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.
Copy link
Contributor

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.

@naegelyd naegelyd force-pushed the issue-172 branch 2 times, most recently from de1df59 to 0d73c2c Compare September 19, 2014 15:45
@@ -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
Copy link
Contributor

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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) when pulling d86fae4 on issue-172 into 0a6e6be on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling 31092b3 on issue-172 into 0a6e6be on master.

@@ -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),
Copy link
Contributor

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.

Copy link
Contributor

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>
bruth added a commit that referenced this pull request Sep 19, 2014
Add field to DataField and DataConcept for excluding from search index
@bruth bruth merged commit aa508e3 into master Sep 19, 2014
@bruth bruth deleted the issue-172 branch September 19, 2014 17:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to exclude data values for fields or models from free-text index
3 participants