示例#1
0
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)
示例#2
0
def main():
    shard2_service = SimpleSearchService(CSV(SEARCH_DOCUMENTS_DATA_FILES2))
    server = ChildSearchServer('shard2', shard2_service)
    server.run_server(port=8012, debug=True)
示例#3
0
 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)
示例#4
0
def main():
    geo_service = GeoService(CSV(GEO_DATA_FILE))
    server = GeoServer('geosearch', geo_service=geo_service)
    server.run_server(debug=True)
示例#5
0
def main():
    user_service = UserService(CSV(USER_DATA_FILE))
    server = UserServer('usersearch', user_service=user_service)
    server.run_server(debug=True)