From 8072db07dda9dfe91e9fe4283b9a0759e228e456 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 29 Jul 2015 13:32:42 -0400 Subject: [PATCH] Index the value field of index nodes. --- .../migrations/0008_auto_20150729_1515.py | 20 +++++++++++++++++++ mayan/apps/document_indexing/models.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 mayan/apps/document_indexing/migrations/0008_auto_20150729_1515.py diff --git a/mayan/apps/document_indexing/migrations/0008_auto_20150729_1515.py b/mayan/apps/document_indexing/migrations/0008_auto_20150729_1515.py new file mode 100644 index 0000000000..f34c84b3d9 --- /dev/null +++ b/mayan/apps/document_indexing/migrations/0008_auto_20150729_1515.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('document_indexing', '0007_auto_20150729_0152'), + ] + + operations = [ + migrations.AlterField( + model_name='indexinstancenode', + name='value', + field=models.CharField(db_index=True, max_length=128, verbose_name='Value', blank=True), + preserve_default=True, + ), + ] diff --git a/mayan/apps/document_indexing/models.py b/mayan/apps/document_indexing/models.py index 0a47d33cd8..ccfa6fad28 100644 --- a/mayan/apps/document_indexing/models.py +++ b/mayan/apps/document_indexing/models.py @@ -125,7 +125,7 @@ class IndexInstanceNode(MPTTModel): verbose_name=_('Index template node') ) value = models.CharField( - blank=True, max_length=128, verbose_name=_('Value') + blank=True, db_index=True, max_length=128, verbose_name=_('Value') ) documents = models.ManyToManyField( Document, related_name='node_instances', verbose_name=_('Documents')