Implement cable_details call
This commit is contained in:
11
search.py
11
search.py
@@ -70,11 +70,10 @@ class JukeboxSearch:
|
||||
|
||||
:param filterables: List of all filterable attributes"""
|
||||
|
||||
existing_filterables = self.idxref.get_filterable_attributes()
|
||||
if len(set(existing_filterables).difference(set(filterables))) > 0:
|
||||
taskref = self.idxref.update_filterable_attributes(filterables)
|
||||
|
||||
self.client.wait_for_task(taskref.index_uid)
|
||||
#existing_filterables = self.idxref.get_filterable_attributes()
|
||||
#if len(set(existing_filterables).difference(set(filterables))) > 0:
|
||||
taskref = self.idxref.update_filterable_attributes(filterables)
|
||||
#self.client.wait_for_task(taskref.index_uid)
|
||||
|
||||
def search(self, query: str, filters: str = None):
|
||||
"""Execute a search query on the Meilisearch index.
|
||||
@@ -95,7 +94,7 @@ class JukeboxSearch:
|
||||
:returns: A dict containing the results; If no results found, an empty dict."""
|
||||
q = self.search("", filter)
|
||||
if q["estimatedTotalHits"] != 0:
|
||||
return ["hits"][0]
|
||||
return q["hits"][0]
|
||||
else:
|
||||
return dict()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user