The last cell has an minor cut and paste error:
from weaviate.classes.query import Rerank
response = collection.query.near_text(
query=“‘I want suggestions to travel during Winter. I want cheap and fun places.’”,
limit=5,
rerank=Rerank(
prop=“attractions”, # The property to rerank on
query=“Fun places” # If not provided, the original query will be used
)
)
for obj in result.objects: =======> This should be “for obj in response.objects”
print_object_properties(obj.properties)
Attached screenshot:
