Configure a lock policy for vector indexes
To improve query efficiency of vector-based search, you can lock vector indexes into the memory by modifying the online table configurations. This method is suitable for scenarios in which high query performance is required.
On the Deployment Management page of your OpenSearch instance, click a Searcher worker.

In the Searcher Worker Configurations panel, click the Online Table Configurations tab. On the Online Table Configurations tab, select an index table from the Index Table drop-down list and click Modify.

Replace the content in the load_config section with the following code. For more information, see Configure an index table loading policy.
{
"file_patterns": [
"/index/${Vector index name}"
],
"load_strategy": "mmap",
"load_strategy_param": {
"slice": 409600,
"lock": true,
"interval": 2
}
},After you modify the online table configurations, the corresponding cluster is rolling upgraded based on the minimum service ratio that is specified on the Online Configurations tab.

Therefore, when you modify online table configurations for a formal online cluster, make sure that the minimum service ratio is greater than 0 and the available Searcher workers can support all existing traffic when the cluster is rolling upgraded based on the minimum service ratio.
Usage notes
The vector indexes that are locked into the memory occupy memory resources of the Searcher worker. We recommend that you configure a lock policy for vector indexes only if the Searcher worker has sufficient memory resources.