Skip to content

Commit

Permalink
Bug fixes to LuceneStore
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Dec 13, 2024
1 parent eec545d commit 5cbd37f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
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 := "1.1.0"
ThisBuild / version := "1.2.0-SNAPSHOT"
ThisBuild / scalaVersion := scala213
ThisBuild / crossScalaVersions := allScalaVersions
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation")
Expand Down
9 changes: 1 addition & 8 deletions lucene/src/main/scala/lightdb/lucene/LuceneStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ class LuceneStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](name: Strin
json: Json,
add: LuceneField => Unit): Unit = {
field.className match {
case Some("lightdb.spatial.Geo.Point") =>
val p = json.as[Geo.Point]
try {
add(new LatLonPoint(field.name, p.latitude, p.longitude))
} catch {
case t: Throwable => throw new RuntimeException(s"Failed to add LatLonPoint(${field.name}, ${p.latitude}, ${p.longitude}): ${JsonFormatter.Default(json)}", t)
}
case _ =>
def indexPoint(p: Geo.Point): Unit = try {
LatLonShape.createIndexableFields(field.name, p.latitude, p.longitude)
Expand Down Expand Up @@ -159,7 +152,7 @@ class LuceneStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](name: Strin
if (json != Null) try {
createGeoFields(field, json, add)
} catch {
case t: Throwable => throw new RuntimeException(s"Failure to populate geo field '$name.${field.name}' for $doc (json: $json)", t)
case t: Throwable => throw new RuntimeException(s"Failure to populate geo field '$name.${field.name}' for $doc (json: $json, className: ${field.className})", t)
}
} else {
d match {
Expand Down

0 comments on commit 5cbd37f

Please sign in to comment.