When loading a batch using the most recent software from Git on Ubuntu I kept getting an error about "language matching query does not exist." (see the paste below). When I added a field in the mysql database for "eng" I then got a solr error saying the required field wasn't found. So, I think this is because language is a required field in the schema.xml for solr AND because there is no default value of "eng" or English found in the mysql language database table when you initially are installing the software. I got it working by adding an "eng" field in mysql and by making the language value optional in the schema.xml. I don't know if this will cause problems down the road, but thought I would mention that it is an issue.
Hope that helps
Batch_loader.py
Starting line: 428
for lang, text in lang_text.iteritems():
try:
language = models.Language.objects.get(Q(code=lang) | Q(lingvoj__iendswith=lang))
except models.Language.DoesNotExist:
# default to english as per requirement
language = models.Language.objects.get(code='eng')
ocr.language_texts.create(language=language,
text=text)
page.ocr = ocr
Here's the output from my batch load before I changed the solr field to optional and added the "eng" field to mysql:
(ENV)ubuntu@ip-10-119-97-242:/opt/chronam/data$ django-admin.py load_batch /opt/chronam/data/batches/batch_vi_affirmed_ver01
INFO:root:loading batch at /opt/chronam/data/batches/batch_vi_affirmed_ver01
INFO:chronam.core.batch_loader:loading batch: batch_vi_affirmed_ver01
INFO:rdflib:version: 3.4.0
INFO:chronam.core.views.image:NativeImage backend '%s' not available.
INFO:chronam.core.views.image:NativeImage backend '%s' not available.
INFO:chronam.core.views.image:Using NativeImage backend 'graphicsmagick'
INFO:chronam.core.batch_loader:Assigned page sequence: 1
INFO:chronam.core.batch_loader:Saving page. issue date: 1886-07-17 00:00:00, page sequence: 1
ERROR:chronam.core.batch_loader:unable to load batch: Language matching query does not exist.
ERROR:chronam.core.batch_loader:Language matching query does not exist.
Traceback (most recent call last):
File "/opt/chronam/core/batch_loader.py", line 166, in load_batch
issue = self._load_issue(mets_url)
File "/opt/chronam/core/batch_loader.py", line 283, in _load_issue
page = self._load_page(doc, page_div, issue)
File "/opt/chronam/core/batch_loader.py", line 405, in _load_page
self.process_ocr(page)
File "/opt/chronam/core/batch_loader.py", line 433, in process_ocr
language = models.Language.objects.get(code='eng')
File "/opt/chronam/ENV/local/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/opt/chronam/ENV/local/lib/python2.7/site-packages/django/db/models/query.py", line 366, in get
% self.model._meta.object_name)
DoesNotExist: Language matching query does not exist.
WARNING:root:no OcrDump to delete for batch_vi_affirmed_ver01 (Library of Virginia; Richmond, VA)
ERROR:chronam.core.management.commands.load_batch:unable to load batch: Language matching query does not exist.
Traceback (most recent call last):
File "/opt/chronam/core/management/commands/load_batch.py", line 39, in handle
batch = loader.load_batch(batch_name)
File "/opt/chronam/core/batch_loader.py", line 195, in load_batch
raise BatchLoaderException(msg)
BatchLoaderException: unable to load batch: Language matching query does not exist.
Error: unable to load batch. check the load_batch log for clues
Mike Beccaria
Systems Librarian
Head of Digital Initiative
Paul Smith's College
518.327.6376
[log in to unmask]
Become a friend of Paul Smith's Library on Facebook today!
|