Indexing how-to

Overview

What do you need to be able to make requests for indexed matching? First, you need to build index on the set of descriptors you are interested in. This is quite slow process, so it is not supposed to be done frequently. Then matcher should load stored index into memory. That is all, its time to match! But let’s look for more details.

Before start

It is recommended to configure indexing sets in LIM Manager settings. In this case indices (re)built (or refresh, see indexing task) automatically, and there is no need to monitor the relevance of indices manually. However, you could also make POST request to /tasks resource for an one-time index build on the set you are interested in.

Indexing

Indexing of a set of descriptors is carried out through queuing tasks.

There are two types of index building tasks:

  • background index building (according to the LIM Manager config)

  • one-time index building (according to explicit request)

There is a pending queue for index building tasks in LIM Manager. The first-come tasks processed first. The state of the task pending queue can be checked with GET request to /queue resource.

Each task has an unique ID, by which it can be tracked. Task info can be obtained with GET request on /tasks resource.

Indexing label

Each index is distinguished by the following parameters:

  • label, i.e. index content unique ID to be used for matching;

  • an unique ID, by which it can be tracked (corresponds to the task ID initiated its creation)

For face list indexing the matching label is always list ID.

Over time in Luna Platform the new objects may be added to the indexed set, or some ones may be excluded. Since indexed set changes, the index becomes outdated. The LIM Manager has a mechanism to rebuild outdated indices for sets specified in the config. Thus, index storage may contain several versions of indices with a particular matching label.

What is next?

Information about indices stored can be obtained with GET request on /indexes, /indexes/labels resources.

Some time after indices are stored, all the running LIM Matcher instances automatically (re)load these indices into memory. Once indices loaded, you can make requests for matching on the indexed sets with the matching label specified.