Vector Search for OpenSearch
Here let's compare the three options available for vector search using the OpenSearch plugin.
Approximate k-NN. This method is ideal for large indices (100k vectors or more). It is a low-latency approach and is scalable. Yet, its fast performance compromises search accuracy. It also does not support pre-filtering.
Script Score k-NN. Script Score is a brute force, exact k-NN search. With brute force search the algorithm completes an exhaustive search. Brute force examines all possible solutions. This approach is more accurate than Approximate k-NN. But, it results in high latencies for large datasets. Script Score allows you to search on a subset of your vectors, also known as pre-filter search. And it can also support binary fields.
Painless Extensions. This is a custom method for complex use cases. As with Script Score, Painless Extensions is a brute force, exact k-NN search. And it allows for pre-filtering.
The Painless Extensions method also supports the use of distance functions. There are many different methods for calculating the distance between two points. The choice of distance function can improve classification accuracy.
Learn more in the linked post below.