Skip to content

Commit

Permalink
Fixed sort support in Lucene for Arr
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Oct 10, 2024
1 parent bd805b2 commit 33a4511
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ val developerURL: String = "https://matthicks.com"

name := projectName
ThisBuild / organization := org
ThisBuild / version := "0.14.3"
ThisBuild / version := "0.14.4-SNAPSHOT"
ThisBuild / scalaVersion := scala213
ThisBuild / crossScalaVersions := allScalaVersions
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation")
Expand Down
2 changes: 2 additions & 0 deletions lucene/src/main/scala/lightdb/lucene/LuceneStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,15 @@ class LuceneStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](directory:
case DefType.Dec => SortField.Type.DOUBLE
case DefType.Int => SortField.Type.LONG
case DefType.Opt(t) => st(t)
case DefType.Arr(t) => st(t)
case _ => throw new RuntimeException(s"Unsupported sort type for ${field.rw.definition}")
}
val sortType = st(field.rw.definition)
def sf(d: DefType): SortField = d match {
case DefType.Int | DefType.Dec => new SortedNumericSortField(fieldSortName, sortType, dir == SortDirection.Descending)
case DefType.Str => new SortField(fieldSortName, sortType, dir == SortDirection.Descending)
case DefType.Opt(t) => sf(t)
case DefType.Arr(t) => sf(t)
case d => throw new RuntimeException(s"Unsupported sort definition: $d")
}
sf(field.rw.definition)
Expand Down

0 comments on commit 33a4511

Please sign in to comment.