Skip to content

Commit

Permalink
Fixed minor bug for indexed fields not being stored in Lucene
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Aug 10, 2024
1 parent 479f113 commit cee13fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions all/src/test/scala/spec/HaloDBAndLuceneSpec.scala
Original file line number Diff line number Diff line change
@@ -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)
}
2 changes: 1 addition & 1 deletion lucene/src/main/scala/lightdb/lucene/LuceneStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cee13fe

Please sign in to comment.