Python Context Manager classes should be added for reading / writing from indices. Closing connections should be automatically handled by the context managers:
e.g.
from pocketsearch import PocketWriter
with PocketWriter() as pocket_writer
pocket_writer.insert(text="Hello world.")
self.assertEqual(pocketsearch.search().count(),1)
and
from pocketsearch import PocketReader
with PocketReader() as pocket_reader:
self.assertEqual(pocket_reader.search(text="Hello world.").count(),0)
Python Context Manager classes should be added for reading / writing from indices. Closing connections should be automatically handled by the context managers:
e.g.
and