Closed
Description
To reproduce,
import tantivy
schema_builder = tantivy.SchemaBuilder()
schema_builder.add_json_field("data", stored=True)
schema = schema_builder.build()
index = tantivy.Index(schema)
index_writer = index.writer()
json_data = {
"name": "John Doe",
"age": 30,
"email": "[email protected]",
"interests": ["reading", "hiking", "coding"],
}
doc = tantivy.Document()
doc.add_json("data", json_data)
index_writer.add_document(doc)
index_writer.commit()
index_writer.wait_merging_threads()
searcher = index.searcher()
query = tantivy.Query.all_query()
top_docs = searcher.search(query, limit=10)
for score, hit in top_docs.hits:
doc = searcher.doc(hit)
print(doc["data"]) # pyo3_runtime.PanicException: not implemented
If json_data
is
json_data = {
"name": "John Doe",
"age": 30,
"email": "[email protected]",
}
then there is no problem.