Exemple #1
0
 def get(self):
     from whoosh import qparser
     qstring = self.get_argument('qstring')
     print qstring
     srch = Searched(options.index, options.__ROOT__)
     hits = srch.didyoumean(qstring)
     self.render('templates/didyoumean.html', hits=hits, qstring=qstring)
Exemple #2
0
 def get(self):
     docpath = self.get_argument('docpath')
     srch = Searched(options.index, options.__ROOT__)
     like_url = srch.morelikethis(docpath)
     self.render('templates/morelikethis.html',
                 docpath=docpath,
                 like_url=like_url)
Exemple #3
0
    def get(self):
        self.clear()
        self.q = self.get_argument('q')
        srch = Searched(options.index, options.__ROOT__, self.q)
        #srch.indexer()
        results = srch.searcher()
        runtime = results.runtime
        occurences = len(results)
        title = []
        url = []
        for index in range(10):
            url.append(results[index]["url"])

        self.render('templates/search.html',
                    q=self.q,
                    runtime=runtime,
                    occurences=occurences,
                    url=url)
Exemple #4
0
 def get(self):
     self.clear()
     self.q = self.get_argument('q')
     srch = Searched(options.index, options.__ROOT__, self.q)
     url, content = srch.highlighted()
     self.render('templates/highlighted.html', url=url, content=content)