Class: Neighbor::Redis::HnswIndex

Inherits:
Index
  • Object
show all
Defined in:
lib/neighbor/redis/hnsw_index.rb

Instance Method Summary collapse

Methods inherited from Index

#add, #add_all, #count, create, #create, #drop, #exists?, #find, #find_in_batches, #info, #member?, #metadata, #promote, #remove, #remove_all, #remove_metadata, #search, #search_id, #set_metadata

Constructor Details

#initialize(*args, initial_cap: nil, m: nil, ef_construction: nil, ef_search: nil, ef_runtime: nil, epsilon: nil, **options) ⇒ HnswIndex

Returns a new instance of HnswIndex.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/neighbor/redis/hnsw_index.rb', line 4

def initialize(
  *args,
  initial_cap: nil,
  m: nil,
  ef_construction: nil,
  ef_search: nil,
  ef_runtime: nil,
  epsilon: nil,
  **options
)
  super(*args, **options)
  @algorithm = "HNSW"
  @initial_cap = initial_cap
  @m = m
  @ef_construction = ef_construction
  @ef_runtime = ef_search || ef_runtime
  @epsilon = epsilon
end