Hello everyone!
it is possibile to make the Document class from the redisearch module a subscriptable class? it would make it easier to access fields if someone needs to remap the search results to other structures in their code
example:
for doc in result.docs:search_output.matches.append(Document(document_id=doc.id, value=doc[filter_name]))
The Document class that I'm using here is another class that i will extend with other values
Hello everyone! it is possibile to make the Document class from the redisearch module a subscriptable class? it would make it easier to access fields if someone needs to remap the search results to other structures in their code
example:
for doc in result.docs:
search_output.matches.append(Document(document_id=doc.id, value=doc[filter_name]))
The
Document
class that I'm using here is another class that i will extend with other valuesright now, this code returns an error that tells:
TypeError: 'Document' object is not subscriptable
Thank you