<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>solr/facet.py</filename>
    </added>
    <added>
      <filename>solr/log2.py</filename>
    </added>
    <added>
      <filename>solr/search/__init__.py</filename>
    </added>
    <added>
      <filename>solr/search/code.py</filename>
    </added>
    <added>
      <filename>solr/search/templates/search.html</filename>
    </added>
    <added>
      <filename>solr/solr_client.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -16,6 +16,7 @@ oca_map = open('oca-map.log', 'a')
 solr = ('localhost', 8983)
 
 from infogami.tdb.logger import parse, parse1, parse2a, parse2b
+import infogami.tdb.tdb
 import web
 
 import re
@@ -56,9 +57,12 @@ setup()
 import solr_fields
 
 def main():
+    import time as _time
+
     global t,k
     # out = open('solr.xml', 'w')
     t1 = t0 = time()
+    print 'start time: ', _time.ctime(t0)
 
     log_fd = open(logfile)
     lastpos_fd = open('lastpos', 'r+', 0)
@@ -80,7 +84,8 @@ def main():
 
         outbuf = StringIO()
         print &gt;&gt;outbuf, &quot;&lt;%s&gt;&quot;% action
-        emit_doc (outbuf, action, t)
+        if emit_doc (outbuf, action, t) is None:
+            continue
         print &gt;&gt;outbuf, &quot;&lt;/%s&gt;&quot;% action
 
         if 1:
@@ -126,13 +131,14 @@ sorted_field_dict = {
 
 ids_seen = set()
 
-def emit_doc(outbuf, action, t):
-    assert t.name not in ids_seen
+def emit_doc(outbuf, action, t, loss=count()):
+    assert t.name not in ids_seen, t.name
     for forbidden in ('text', 'identifier'):
         assert forbidden not in t.d
     ids_seen.add(t.name)
 
     print &gt;&gt;outbuf, &quot;&lt;doc&gt;&quot;
+
     emit_field(outbuf, 'identifier', t.name)
 
     if 'oca_identifier' in t.d:
@@ -142,7 +148,12 @@ def emit_doc(outbuf, action, t):
     if action != 'delete':
         for k in t.d:
             v = getattr(t.d, k)
-            emit_field(outbuf, k, v)
+
+            try:
+                emit_field(outbuf, k, v)
+            except infogami.tdb.tdb.NotFound, e:
+                print ('dropping', loss.next(), time(), t.name)
+                return None
 
             if k in solr_fields.singleton_fields:
                 # should do something better than crash the importer</diff>
      <filename>solr/logdaemon.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eb6517555dedd54869c837185c843726ef4de4b4</id>
    </parent>
  </parents>
  <author>
    <name>phr@pharosdb.us.archive.org</name>
    <email>phr@pharosdb.us.archive.org</email>
  </author>
  <url>http://github.com/openlibrary/openlibrary/commit/41646a32b52b4900ab6a071a6bfd968e9c246a6c</url>
  <id>41646a32b52b4900ab6a071a6bfd968e9c246a6c</id>
  <committed-date>2007-06-21T16:01:05-07:00</committed-date>
  <authored-date>2007-06-21T16:01:05-07:00</authored-date>
  <message>reinsert several template-related files that disappeared from repository somehow.</message>
  <tree>8dd478285b8ad61bcd7fca7981de3ccccef28388</tree>
  <committer>
    <name>phr@pharosdb.us.archive.org</name>
    <email>phr@pharosdb.us.archive.org</email>
  </committer>
</commit>
