Spaces:
Build error
Build error
Commit
·
955af6a
1
Parent(s):
6a501ae
Update weaviate_utils.py
Browse files- weaviate_utils.py +8 -9
weaviate_utils.py
CHANGED
|
@@ -11,18 +11,17 @@ def hybrid_search_weaviate(client, selected_class, query):
|
|
| 11 |
Perform a hybrid search on Weaviate using the provided class and query.
|
| 12 |
Return the results as a list of dictionaries.
|
| 13 |
"""
|
| 14 |
-
# Construct the
|
| 15 |
-
st.write(f"Search query type: {type(search_query)}, Value: {search_query}")
|
| 16 |
-
|
| 17 |
search_query = {
|
| 18 |
-
"
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
| 22 |
}
|
| 23 |
-
|
| 24 |
# Perform the hybrid search
|
| 25 |
-
results = client.query.get(search_query)
|
| 26 |
|
| 27 |
return results
|
| 28 |
|
|
|
|
| 11 |
Perform a hybrid search on Weaviate using the provided class and query.
|
| 12 |
Return the results as a list of dictionaries.
|
| 13 |
"""
|
| 14 |
+
# Construct the search query
|
|
|
|
|
|
|
| 15 |
search_query = {
|
| 16 |
+
"query": {
|
| 17 |
+
"path": ["*"],
|
| 18 |
+
"operator": "fuzzy",
|
| 19 |
+
"value": query
|
| 20 |
+
}
|
| 21 |
}
|
| 22 |
+
|
| 23 |
# Perform the hybrid search
|
| 24 |
+
results = client.query.get(selected_class, search_query) # Updated this line
|
| 25 |
|
| 26 |
return results
|
| 27 |
|