Skip to content

Matching plugin for Python Matcher Proxy#

Using the LUNA Vinder Plugin, the Python Matcher Proxy service can redirect matching requests from the API service to either the Python Matcher service or the LUNA Vinder Module module's Matcher service. The plugin's operation and how to select the service to search are described below.

The matching plugin is already built into the Python Matcher Proxy service's Docker container. You only need to enable it (see the installation guide).

Matching plugin description#

Each similar object search request is represented as a combination of candidates and references. The plugin processes each combination as a separate subquery as follows:

  • request analysis — the plugin checks the query parameters for compatibility with available LUNA Vinder Module projections and indexes.
  • Processing method selection — determines whether the request can be processed by the LUNA Vinder Module module's Matcher or should be forwarded to the Python Matcher service. If so, the request is forwarded to the appropriate LUNA Vinder Module Matcher instance.
  • Result generation — if necessary, the Python Matcher Proxy supplements the response with data from the main database and returns it to the user.

Criteria for choosing a service for matching#

The matching plugin analyzes each request and makes a routing decision based on the following criteria:

1. Availability of a suitable projection. At least one projection with a matching data source (origin) and compatible filters and targets exists. 2. Index availability. An index must exist in the selected projection. If a projection contains filters but the index does not contain fields for these filters, matching is still possible using this projection if the filters in the request match the filters in the projection. If composite fields are present in the index, they must cover all filters in the request. 3. Availability of target fields. All attributes from the request filters that do not match the filters in the projection must be present in the target fields list of the selected projection.

If the request does not meet at least one of the criteria, the matching plugin redirects it to Python Matcher for further processing.

LUNA PLATFORM can use multiple matching plugins. See the Matching Plugins section of the LUNA PLATFORM Administrator manual for details.