fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
some fixes to oaipmh: namespaces
[wolnelektury.git]
/
apps
/
search
/
index.py
diff --git
a/apps/search/index.py
b/apps/search/index.py
index
da54fe7
..
557f404
100644
(file)
--- a/
apps/search/index.py
+++ b/
apps/search/index.py
@@
-201,7
+201,6
@@
class Index(SolrIndex):
"is_pdcounter": False,
"uid": "tag%d" % tag.id
}
"is_pdcounter": False,
"uid": "tag%d" % tag.id
}
- print "ADD 1 %s" % doc
self.index.add(doc)
def create_book_doc(self, book):
self.index.add(doc)
def create_book_doc(self, book):
@@
-250,7
+249,6
@@
class Index(SolrIndex):
book_doc[n] = f
book_doc['uid'] = "book%s" % book_doc['book_id']
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 = {
self.index.add(book_doc)
del book_doc
book_fields = {
@@
-462,7
+460,6
@@
class Index(SolrIndex):
doc = add_part(snippets, header_index=position, header_type=header.tag,
text=u''.join(footnote),
is_footnote=True)
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 = []
self.index.add(doc)
#print "@ footnote text: %s" % footnote
footnote = []
@@
-498,7
+495,6
@@
class Index(SolrIndex):
text=fix_format(frag['text']),
themes=frag['themes'])
#print '@ FRAG %s' % frag['content']
text=fix_format(frag['text']),
themes=frag['themes'])
#print '@ FRAG %s' % frag['content']
- print "ADD 4 %s" % doc
self.index.add(doc)
# Collect content.
self.index.add(doc)
# Collect content.
@@
-513,7
+509,6
@@
class Index(SolrIndex):
header_type=header.tag, text=fix_format(content))
#print '@ CONTENT: %s' % fix_format(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:
self.index.add(doc)
finally:
@@
-653,7
+648,6
@@
class SearchResult(object):
except catalogue.models.Fragment.DoesNotExist:
# stale index
continue
except catalogue.models.Fragment.DoesNotExist:
# stale index
continue
- print f
# Figure out if we were searching for a token matching some word in theme name.
themes = frag.tags.filter(category='theme')
themes_hit = set()
# Figure out if we were searching for a token matching some word in theme name.
themes = frag.tags.filter(category='theme')
themes_hit = set()
@@
-958,7
+952,6
@@
class Search(SolrIndex):
continue
text = snippets.get((int(position),
int(length)))
continue
text = snippets.get((int(position),
int(length)))
- print "== %s -- %s ==" % (query, text)
snip = self.index.highlight(text=text, field=field, q=query)
snips[idx] = snip
if snip:
snip = self.index.highlight(text=text, field=field, q=query)
snips[idx] = snip
if snip:
@@
-975,6
+968,7
@@
class Search(SolrIndex):
snips = map(lambda s: s and s.replace("/\n", "\n"), snips)
searchresult.snippets = snips
snips = map(lambda s: s and s.replace("/\n", "\n"), snips)
searchresult.snippets = snips
+
return snips
def hint_tags(self, query, pdcounter=True, prefix=True):
return snips
def hint_tags(self, query, pdcounter=True, prefix=True):