tool_shed.webapp.search package
Submodules
tool_shed.webapp.search.repo_search module
Module for searching the toolshed repositories
- class tool_shed.webapp.search.repo_search.RepoWeighting(B=0.75, K1=1.2, **kwargs)[source]
Bases:
BM25F
Affect the BM25G scoring model through the final method. source: https://groups.google.com/forum/#!msg/whoosh/1AKNbW8R_l8/XySW0OecH6gJ
- use_final = True
- final(searcher, docnum, score)[source]
Returns a final score for each document. You can use this method in subclasses to apply document-level adjustments to the score, for example using the value of stored field to influence the score (although that would be slow).
WeightingModel sub-classes that use
final()
should have the attributeuse_final
set toTrue
.- Parameters:
searcher –
whoosh.searching.Searcher
for the index.docnum – the doc number of the document being scored.
score – the document’s accumulated term score.
- Return type:
- class tool_shed.webapp.search.repo_search.RepoSearch[source]
Bases:
object
- search(trans, search_term, page, page_size, boosts)[source]
Perform the search on the given search_term
- Parameters:
search_term – unicode encoded string with the search term(s)
boosts – namedtuple containing custom boosts for searchfields, see api/repositories.py
page_size – integer defining a length of one page
page – integer with the number of page requested
- Returns results:
dictionary containing hits themselves and the hits summary
tool_shed.webapp.search.tool_search module
Module for searching the toolshed tools within all repositories