The KnrIndex index structure

struct KnrIndex <: AbstractSearchIndex

The K nearest references inverted index


  • dist: the distance function of the index
  • db: the database of indexed objects
  • centers: a search index for a set of references
  • invfile: an inverted file data structure
  • kbuild: the number of references to be computed and stored by each indexed object
  • ordering: specifies how the index performs final k nn selection
  • opt: the parameters to be optimized by optimize_index!
Missing docstring.

Missing docstring for `````

Searching the index

We follow the searching api of SimilaritySearch such that you can use searchbatch, and allknn for free.`. Check Documenter's build log for details.

@docs search

## Inserting elements into the index

@docs index! append! push!

## Ordering (reranking) strategies
KnrOrderingStrategies, DistanceOrdering, InternalDistanceOrdering, DistanceOnTopKOrdering

## Optimizing performance

@docs optimize!

## Computing references
The `KnrIndex` index uses a small set of references, that follow the dataset distribution to encode objects and
search construct and search the index. Please note that in average, we expect $n/m$ posting lists if `kbuild=1`, and therefore this will be the number of elements to verify. In practice, the distribution is far from being uniform and vary with the data. In part, this can be manipulated with a proper selection of the set of references.

@docs references ```

The function references is a convenient function to select references efficiently and easily. In any case, it is possible to use any sampling or clustering algorithm to compute the set of references. See for example