Port Manticore and debug
This commit is contained in:
@@ -253,7 +253,6 @@ class StorageBackend(ABC):
|
||||
"took": time_took_rounded,
|
||||
"cache": True,
|
||||
}
|
||||
print("S2", search_query)
|
||||
response = self.run_query(user, search_query, **kwargs)
|
||||
|
||||
# For Elasticsearch
|
||||
|
||||
@@ -57,7 +57,6 @@ class ManticoreBackend(StorageBackend):
|
||||
"limit": size,
|
||||
"query": {"bool": {"must": []}},
|
||||
}
|
||||
print("BASE", query_base)
|
||||
query_string = {
|
||||
"query_string": query,
|
||||
}
|
||||
@@ -77,7 +76,6 @@ class ManticoreBackend(StorageBackend):
|
||||
raw = kwargs.get("raw")
|
||||
if search_query and not raw:
|
||||
search_query["index"] = index
|
||||
pprint(search_query)
|
||||
|
||||
|
||||
path = kwargs.get("path", "json/search")
|
||||
@@ -98,7 +96,6 @@ class ManticoreBackend(StorageBackend):
|
||||
"""
|
||||
index = kwargs.get("index")
|
||||
search_query["index"] = index
|
||||
pprint(search_query)
|
||||
async with httpx.AsyncClient() as client:
|
||||
response = await client.post(
|
||||
f"{settings.MANTICORE_URL}/json/search", json=search_query
|
||||
|
||||
@@ -94,7 +94,7 @@ def parse_results(results, meta=None):
|
||||
del element[field]
|
||||
# Unfold the tokens
|
||||
if "tokens" in element:
|
||||
if element["tokens"].startswith('["'):
|
||||
if element["tokens"].startswith('["') or element["tokens"].startswith("['"):
|
||||
tokens_parsed = ast.literal_eval(element["tokens"])
|
||||
element["tokens"] = tokens_parsed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user