import traceback
from django.core.management.base import BaseCommand
from karmaworld.apps.notes.models import Note
-from karmaworld.apps.notes.search import *
+from karmaworld.apps.notes.search import SearchIndex
class Command(BaseCommand):
args = 'none'
"in the index that are not overwritten will still be around."
def handle(self, *args, **kwargs):
+ index = SearchIndex()
for note in Note.objects.iterator():
try:
print "Indexing {n}".format(n=note)
- add_document(note)
+ index.add_note(note)
except Exception, e:
traceback.print_exc()
continue
import os
import urllib
-from boto.s3.acl import Grant
-
from django.conf import settings
from django.core.files import File
from django.core.files.storage import FileSystemStorage
new_note.course != old_note.course or \
new_note.uploaded_at != old_note.uploaded_at:
logger.info("Indexing {n}".format(n=new_note))
- #self.index.add_document(new_note.id, SearchIndex._note_to_dict(new_note), variables={0: new_note.thanks})
+ self.index.add_document(new_note.id, SearchIndex._note_to_dict(new_note), variables={0: new_note.thanks})
# If only the thanks count has changed, we can
# just send that
FILEPICKER_API_KEY = fp_api
+from karmaworld.secret.static_s3 import *
SERIALIZATION_MODULES = {'json-pretty': 'karmaworld.apps.serializers.json_pretty'}
from common import *
-from karmaworld.secret.static_s3 import *
-
from karmaworld.secret.db_settings import PROD_DB_NAME
from karmaworld.secret.db_settings import PROD_DB_USERNAME
from karmaworld.secret.db_settings import PROD_DB_PASSWORD
git+https://github.com/flaptor/indextank-py.git
html2text
django-allauth
+boto==2.6.0
+django-storages==1.1.4
-r common.txt
-boto==2.6.0
cssmin==0.1.4
pylibmc==1.2.3
-django-storages==1.1.4
gunicorn==0.14.3
jsmin==2.0.2
psycopg2==2.4.5