Search an Annoy index built from a bigmemory::big.matrix
Source: R/annoy_interface.R
annoy_search_bigmatrix.RdQuery 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_indexreturned byannoy_build_bigmatrix(),annoy_open_index(), orannoy_load_bigmatrix().- query
Optional query source. Supply
NULLfor self-search, anotherbig.matrixor external pointer for streamed queries, or a dense numeric matrix.- k
Number of neighbours to return.
- search_k
Annoy's runtime search budget. Use
-1Lfor the library default.- xpIndex
Optional writable
bigmemory::big.matrixor external pointer receiving the 1-based neighbour indices.- xpDistance
Optional writable
bigmemory::big.matrixor external pointer receiving the Annoy distances. It may only be supplied whenxpIndexis 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.