0

I am trying to create a plugin for solr that will enable indexing 3d models. I will take 'screenshots' of each model from several different views and preprocess those images so they'll be represented in 1d vector.

I wanted to use lucene/solr Geospatial search for that purpose, as I saw there is an option to index a vector (larger than 2 dims) and search according to distance form the vector (according to location).

Unfortunately the documentation for this option disappeared last week and it isn't cached in google.

How can I index a location vector with dimension > 2?

The link for the documentation was here: https://wiki.apache.org/solr

And I found it from here: https://lucene.apache.org/solr/guide/6_6/spatial-search.html#SpatialSearch-LatLonPointSpatialField

HDolev
  • 193
  • 1
  • 9
  • You can still access [the old wiki through the Wayback Machine](https://web.archive.org/web/20190326201547/https://wiki.apache.org/solr/SpatialSearch). – MatsLindh Jul 15 '19 at 09:57

1 Answers1

1

Geospatial search is intended to work with n-dimension points (Lucene), but it seems the Solr implementation for dimensions higher than 2d is not available.

You can still do 3d spatial search with Solr if you index one dimension vector/coordinate per field (use a double fieldType).

Then, in order to query and sort documents by distance from a given point, instead of using geodist(sfield2D,x,y), you may use dist() :

Returns the distance between two vectors (points) in an n-dimensional space. Takes in the power, plus two or more ValueSource instances and calculates the distances between the two vectors.

To compute the euclidean distance between an arbitrary point (0,0,0) and the indexed points for each document, you would use :

dist(2, fieldx, fieldy, fieldz, 0, 0, 0) 

See also :
- Calculate distance in 3D space
- Distance Sorting or Boosting (Function Queries)
- Difference between geodist() and dist() for Geo-Spacial Search

EricLavault
  • 12,130
  • 3
  • 23
  • 45