def pre_load(): """Pre-load citation dictionaries upon WSGI application start-up. The citation dictionaries are loaded lazily, which is good for CLI processes such as bibsched, but for web user queries we want them to be available right after web server start-up. """ # FIXME: move to invenio.modules.ranker.views when its created try: from invenio.legacy.bibrank.citation_searcher import get_citedby_hitset, get_refersto_hitset get_citedby_hitset(None) get_refersto_hitset(None) except: pass
def pre_load(): """Pre-load citation dictionaries upon WSGI application start-up. The citation dictionaries are loaded lazily, which is good for CLI processes such as bibsched, but for web user queries we want them to be available right after web server start-up. """ # FIXME: move to invenio.modules.ranker.views when its created try: from invenio.legacy.bibrank.citation_searcher import \ get_citedby_hitset, \ get_refersto_hitset get_citedby_hitset(None) get_refersto_hitset(None) except Exception: pass
def search_unit(query, f, m, wl=None): """Search for records referred to by matched records.""" from invenio.legacy.search_engine import search_pattern from invenio.legacy.bibrank.citation_searcher import get_refersto_hitset if query: if isinstance(query, intbitset): ahitset = query else: ahitset = search_pattern(p=query) return get_refersto_hitset(ahitset) else: return intbitset([])