doc = add_part(snippets, header_index=position, header_type=header.tag, content=content)
self.index.addDocument(doc)
doc = add_part(snippets, header_index=position, header_type=header.tag, content=content)
self.index.addDocument(doc)
for start, end in walker(header):
if start is not None and start.tag == 'begin':
fid = start.attrib['id'][1:]
for start, end in walker(header):
if start is not None and start.tag == 'begin':
fid = start.attrib['id'][1:]
hit = (sec + (header_span,), fragment, scoreDocs.score, {'how_found': how_found, 'snippets': snippets and [snippets] or []})
self._hits.append(hit)
hit = (sec + (header_span,), fragment, scoreDocs.score, {'how_found': how_found, 'snippets': snippets and [snippets] or []})
self._hits.append(hit)
self.chain_filters([only_in, self.term_filter(Term('is_book', 'true'))]),
max_results)
for found in top.scoreDocs:
self.chain_filters([only_in, self.term_filter(Term('is_book', 'true'))]),
max_results)
for found in top.scoreDocs:
return books
def search_book(self, searched, max_results=20, fuzzy=False, hint=None):
return books
def search_book(self, searched, max_results=20, fuzzy=False, hint=None):
self.chain_filters([only_in, self.term_filter(Term('is_book', 'true'))]),
max_results)
for found in top.scoreDocs:
self.chain_filters([only_in, self.term_filter(Term('is_book', 'true'))]),
max_results)
for found in top.scoreDocs:
- books.append(SearchResult(self.searcher, found, snippets=self.get_snippets(found, q)))
+ books.append(SearchResult(self.searcher, found, snippets=self.get_snippets(found, q), how_found='search_perfect_parts'))
topDocs = self.searcher.search(q, only_in, max_results)
for found in topDocs.scoreDocs:
topDocs = self.searcher.search(q, only_in, max_results)
for found in topDocs.scoreDocs:
print "* %s theme x content: %s" % (searched, books[-1]._hits)
# query themes/content x author/title/tags
print "* %s theme x content: %s" % (searched, books[-1]._hits)
# query themes/content x author/title/tags
topDocs = self.searcher.search(q, only_in, max_results)
for found in topDocs.scoreDocs:
topDocs = self.searcher.search(q, only_in, max_results)
for found in topDocs.scoreDocs: