Skip to content

Commit

Permalink
Fixed Lucene indexing of polygons
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Sep 6, 2024
1 parent d885c9e commit cc96a8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lucene/src/main/scala/lightdb/lucene/LuceneStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class LuceneStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](directory:
val p = json.as[Geo.Point]
add(new LatLonPoint(field.name, p.latitude, p.longitude))
case _ =>
// Treat everything else like a LatLonShape (LatLonShape.createIndexableFields("", p.latitude, p.longitude))
def indexPoint(p: Geo.Point): Unit = LatLonShape.createIndexableFields(field.name, p.latitude, p.longitude)
def indexLine(l: Geo.Line): Unit = {
val line = new Line(l.points.map(_.latitude).toArray, l.points.map(_.longitude).toArray)
Expand All @@ -70,7 +69,8 @@ class LuceneStore[Doc <: Document[Doc], Model <: DocumentModel[Doc]](directory:
def indexPolygon(p: Geo.Polygon): Unit = {
def convert(p: Geo.Polygon): Polygon =
new Polygon(p.points.map(_.latitude).toArray, p.points.map(_.longitude).toArray)
convert(p)
val polygon = convert(p)
LatLonShape.createIndexableFields(field.name, polygon)
}
val geo = json.as[Geo]
geo match {
Expand Down

0 comments on commit cc96a8a

Please sign in to comment.