1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/local/bin/python
import sys
import os

sys.path.append('/Users/kwe/Sites/django/django_projects')
os.environ["DJANGO_SETTINGS_MODULE"] = 'beans4.settings'

from beans4.gallery.models import *
from solr import *

c = SolrConnection(host='localhost:8983', persistent=True)

items = Photo.objects.all()
for i in items:
    c.add(id=i.id,filename_t=i.filename,caption_t= i.caption, event_t=i.event.picsUrl)
    
c.commit()
c.optimise()