Persistent map that implements the Java Map interface. Keys and values have to implement the Serializable interface. Based on the Lucene 6 NRT search.
Map<String, String> map = new LuceneMap<>();
To get an in-memory map that is not persistent:
Map<String, String> map = new LuceneMap<>(StorageLocation.RAM);
To specify the folder where the map data is stored:
Map<String, String> map = new LuceneMap<>("my/dir");
LuceneMap is thread-safe as it relies on the Lucene IndexWriter for storing values and the Lucene SearcherManager for reading values.
- keys and values cannot exceed 32 KB.
- put() might return an outdated value (performance trade-off).