diff --git a/pandora/document/managers.py b/pandora/document/managers.py index b55afeeac..7f0453908 100644 --- a/pandora/document/managers.py +++ b/pandora/document/managers.py @@ -36,6 +36,8 @@ def get_key_type(k): }.get(key_type, key_type) return key_type + + def parseCondition(condition, user, item=None, owner=None): ''' ''' @@ -68,6 +70,9 @@ def buildCondition(k, op, v, user, exclude=False, owner=None): k = 'collection' key_type = get_key_type(k) + + key_config = (utils.get_by_id(settings.CONFIG['documentKeys'], k) or {'type': 'string'}).get('type') + facet_keys = models.Document.facet_keys if k == 'id': if op == '&' and isinstance(v, list): @@ -128,7 +133,7 @@ def buildCondition(k, op, v, user, exclude=False, owner=None): else: q = Q(id=0) return q - elif key_type == 'fulltext': + elif key_config.fulltext: qs = models.Document.find_fulltext_ids(v) q = Q(id__in=qs) if exclude: diff --git a/pandora/document/models.py b/pandora/document/models.py index a436360ae..0c61f0192 100644 --- a/pandora/document/models.py +++ b/pandora/document/models.py @@ -154,7 +154,9 @@ class Document(models.Model, FulltextMixin): i = key['id'] if i == 'rightslevel': save(i, self.rightslevel) - elif i not in ('*', 'dimensions', 'fulltext') and i not in self.facet_keys: + if key.get('fulltext'): + continue + elif i not in ('*', 'dimensions') and i not in self.facet_keys: value = data.get(i) if isinstance(value, list): value = u'\n'.join(value)