From cee13fe8da8d1502290135902c8f9182ab2c8ac1 Mon Sep 17 00:00:00 2001 From: Matt Hicks Date: Sat, 10 Aug 2024 10:20:37 -0500 Subject: [PATCH] Fixed minor bug for indexed fields not being stored in Lucene --- all/src/test/scala/spec/HaloDBAndLuceneSpec.scala | 4 ++-- lucene/src/main/scala/lightdb/lucene/LuceneStore.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/all/src/test/scala/spec/HaloDBAndLuceneSpec.scala b/all/src/test/scala/spec/HaloDBAndLuceneSpec.scala index 48558ea4..5e3cfc74 100644 --- a/all/src/test/scala/spec/HaloDBAndLuceneSpec.scala +++ b/all/src/test/scala/spec/HaloDBAndLuceneSpec.scala @@ -1,11 +1,11 @@ package spec import lightdb.halodb.HaloDBStore import lightdb.lucene.LuceneStore -import lightdb.store.StoreManager +import lightdb.store.{StoreManager, StoreMode} import lightdb.store.split.SplitStoreManager class HaloDBAndLuceneSpec extends AbstractBasicSpec { override protected def filterBuilderSupported: Boolean = true - override def storeManager: StoreManager = SplitStoreManager(HaloDBStore, LuceneStore) //, searchingMode = StoreMode.Indexes) + override def storeManager: StoreManager = SplitStoreManager(HaloDBStore, LuceneStore, searchingMode = StoreMode.Indexes) } diff --git a/lucene/src/main/scala/lightdb/lucene/LuceneStore.scala b/lucene/src/main/scala/lightdb/lucene/LuceneStore.scala index 28acce84..2570c9b4 100644 --- a/lucene/src/main/scala/lightdb/lucene/LuceneStore.scala +++ b/lucene/src/main/scala/lightdb/lucene/LuceneStore.scala @@ -51,7 +51,7 @@ class LuceneStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](directory: } private def createLuceneFields(field: Field[Doc, _], doc: Doc): List[LuceneField] = { - def fs: LuceneField.Store = if (storeMode == StoreMode.All || field.name == "_id") LuceneField.Store.YES else LuceneField.Store.NO + def fs: LuceneField.Store = if (storeMode == StoreMode.All || field.indexed) LuceneField.Store.YES else LuceneField.Store.NO val json = field.getJson(doc) var fields = List.empty[LuceneField] def add(field: LuceneField): Unit = fields = field :: fields