Class indexing books.
"""
def __init__(self):
- super(Index, self).__init__()
+ super(Index, self).__init__(mode='rw')
def delete_query(self, *queries):
"""
"is_pdcounter": False,
"uid": "tag%d" % tag.id
}
+ print "ADD 1 %s" % doc
self.index.add(doc)
def create_book_doc(self, book):
book_doc[n] = f
book_doc['uid'] = "book%s" % book_doc['book_id']
+ print "ADD 2 %s" % book_doc
self.index.add(book_doc)
del book_doc
book_fields = {
doc = add_part(snippets, header_index=position, header_type=header.tag,
text=u''.join(footnote),
is_footnote=True)
-
+ print "ADD 3 %s" % doc
self.index.add(doc)
#print "@ footnote text: %s" % footnote
footnote = []
text=fix_format(frag['text']),
themes=frag['themes'])
#print '@ FRAG %s' % frag['content']
+ print "ADD 4 %s" % doc
self.index.add(doc)
# Collect content.
header_type=header.tag, text=fix_format(content))
#print '@ CONTENT: %s' % fix_format(content)
+ print "ADD 5 %s" % doc
self.index.add(doc)
finally:
Search facilities.
"""
def __init__(self, default_field="text"):
- super(Search, self).__init__()
+ super(Search, self).__init__(mode='r')
# def get_tokens(self, searched, field='text', cached=None):
# """returns tokens analyzed by a proper (for a field) analyzer