ankane / neighbor

Nearest neighbor search for Rails
MIT License
589 stars 14 forks source link

Access to `neighbor_distance` when using `nearest_neighbors` #6

Closed henrikbjorn closed 1 year ago

henrikbjorn commented 1 year ago

I found out that if i add attribute :neighbor_distance to my model. Then I will get the distance set on my models from the query. This is not exactly the max_distance option from the Ideas issue. But better than nothing.


class Document < ApplicationRecord
  has_neighbors :embedding

  attribute :neighbor_distance
end