def metasearch(): # user_service = UserService(CSV(USER_DATA_FILE)) # geo_service = GeoService(CSV(GEO_DATA_FILE)) search = SearchInShardsService(shards=[ SimpleSearchService(CSV(file)) for file in SEARCH_DOCUMENTS_DATA_FILES ]) return MetaSearchService(search)
def main(): shard2_service = SimpleSearchService(CSV(SEARCH_DOCUMENTS_DATA_FILES2)) server = ChildSearchServer('shard2', shard2_service) server.run_server(port=8012, debug=True)
def __init__(self, data_source: CSV): self._data = data_source.read_data(to_dict=False) for col in ('network', 'country_name'): assert col in self._data.columns self._networks = self._data['network'].apply(ip.ip_network)
def main(): geo_service = GeoService(CSV(GEO_DATA_FILE)) server = GeoServer('geosearch', geo_service=geo_service) server.run_server(debug=True)
def main(): user_service = UserService(CSV(USER_DATA_FILE)) server = UserServer('usersearch', user_service=user_service) server.run_server(debug=True)