I'm trying to have my collection of indexed documents searchable using console input, I get a Serialization error and I don't understand why or how to fix it. I get that it's an error of the type of my variable, but I'm not sure if its giving the wrong type or wants a different type.
searchstr = input("Search for a character \n")
body = {"query": {"prefix" : { "name": { searchstr } } } }
print(es.search(index="sw", doc_type="people", body=body))
Here's the error; elasticsearch.exceptions.SerializationError: ({'query': {'prefix': {'name': {'Lu'}}}}, TypeError("Unable to serialize {'Lu'} (type: <class 'set'>)",))