Skip to contents

Query a persisted Annoy index created by annoy_build_bigmatrix() or reopened with annoy_open_index(). Supply query = NULL for self-search over the indexed reference rows, or provide a dense numeric matrix, big.matrix, or external pointer for external-query search. Results can be returned in memory or streamed into destination big.matrix objects.

Usage

annoy_search_bigmatrix(
  index,
  query = NULL,
  k = 10L,
  search_k = -1L,
  xpIndex = NULL,
  xpDistance = NULL,
  prefault = NULL,
  block_size = annoy_default_block_size()
)

Arguments

index

A bigannoy_index returned by annoy_build_bigmatrix(), annoy_open_index(), or annoy_load_bigmatrix().

query

Optional query source. Supply NULL for self-search, another big.matrix or external pointer for streamed queries, or a dense numeric matrix.

k

Number of neighbours to return.

search_k

Annoy's runtime search budget. Use -1L for the library default.

xpIndex

Optional writable bigmemory::big.matrix or external pointer receiving the 1-based neighbour indices.

xpDistance

Optional writable bigmemory::big.matrix or external pointer receiving the Annoy distances. It may only be supplied when xpIndex is also provided.

prefault

Optional logical override controlling whether the native backend prefaults the Annoy file while loading it for search.

block_size

Number of queries processed per block.

Value

A list with components index, distance, k, metric, n_ref, n_query, exact, and backend.