Added API commands

This commit is contained in:
Simon
2018-07-15 21:21:57 -04:00
parent 8a19fa0ce7
commit 0227684a53
6 changed files with 85 additions and 173 deletions

View File

@@ -1,7 +1,6 @@
import os
import json
import shutil
import sys
from search.search import ElasticSearchEngine
from concurrent.futures import ThreadPoolExecutor
import requests
@@ -16,6 +15,7 @@ exts = [
"so", "dll", "tar", "gz", "bin", "cad", "cmd", "bat", "sh", "md"
]
def dump_local_filesystem(root_dir: str):
docs = []
@@ -71,7 +71,7 @@ def index_file_list(path: str, website_id):
def search(term=""):
requests.get("http://localhost/?&sort_order=score&per_page=100q=" + term, verify=False)
requests.get("http://localhost/search?q=" + term, verify=False)
print(term)
@@ -91,7 +91,7 @@ def make_wide_filesystem(count=100000):
os.mkdir(new_path)
dump_local_filesystem("/mnt/")
# dump_local_filesystem("/mnt/")
# index_file_list("local_filesystem.json", 4)
# random_searches(100000)
# dump_random_files(20000 * 100000)