|
|
@ -84,7 +84,12 @@ def run_query(client, user, search_query):
|
|
|
|
response["cache"] = True
|
|
|
|
response["cache"] = True
|
|
|
|
return response
|
|
|
|
return response
|
|
|
|
response = client.search(search_query)
|
|
|
|
response = client.search(search_query)
|
|
|
|
|
|
|
|
print("PRERESP", response)
|
|
|
|
response = response.to_dict()
|
|
|
|
response = response.to_dict()
|
|
|
|
|
|
|
|
print("RESP", response)
|
|
|
|
|
|
|
|
if "took" in response:
|
|
|
|
|
|
|
|
if response["took"] is None:
|
|
|
|
|
|
|
|
return None
|
|
|
|
filter_blacklisted(user, response)
|
|
|
|
filter_blacklisted(user, response)
|
|
|
|
|
|
|
|
|
|
|
|
# Write cache
|
|
|
|
# Write cache
|
|
|
@ -147,7 +152,7 @@ def query_results(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if index == "meta":
|
|
|
|
if index == "meta":
|
|
|
|
index = settings.MANTICORE_INDEX_META
|
|
|
|
index = settings.MANTICORE_INDEX_META
|
|
|
|
elif index == "int":
|
|
|
|
elif index == "internal":
|
|
|
|
index = settings.MANTICORE_INDEX_INT
|
|
|
|
index = settings.MANTICORE_INDEX_INT
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
message = "Index is not valid."
|
|
|
|
message = "Index is not valid."
|
|
|
@ -317,7 +322,9 @@ def query_results(
|
|
|
|
search_query,
|
|
|
|
search_query,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if not results:
|
|
|
|
if not results:
|
|
|
|
return False
|
|
|
|
message = "Error running query"
|
|
|
|
|
|
|
|
message_class = "danger"
|
|
|
|
|
|
|
|
return {"message": message, "class": message_class}
|
|
|
|
# results = results.to_dict()
|
|
|
|
# results = results.to_dict()
|
|
|
|
results_parsed = parse_results(results)
|
|
|
|
results_parsed = parse_results(results)
|
|
|
|
if annotate:
|
|
|
|
if annotate:
|
|
|
|