Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sam-herman
Copy link

@sam-herman sam-herman commented Mar 11, 2025

Overview

This PR adds OpenSearch supported retrieval techniques with BM25, Neural Search and Hybrid Search. And new examples demonstrating how to benchmark BM25, Neural and Hybrid Search capabilities using OpenSearch with the BEIR framework.

Changes

  • Added OpenSearch as a retrieval capability for Neural, Hybrid and BM25 scenarios
  • Added examples/benchmarking/opensearch_benchmark_bm25.py for lexical search benchmarking
  • Added examples/benchmarking/opensearch_benchmark_neural.py for neural search benchmarking
  • Added examples/benchmarking/opensearch_benchmark_hybrid.py for hybrid search benchmarking

Example Usage

Spin an OpenSearch cluster with the neural-search plugin installed.
The easiest would be to

# Clone opensearch standard neural search plugin to use Lucene/Faiss/NMSLib for KNN engines
git clone https://github.com/opensearch-project/neural-search.git
# Or alternatively clone the jvector opensearch plugin to use the jvector engine (should be added to the opensearch project this week)
git clone https://github.com/sam-herman/opensearch-jvector-plugin

# start an opensearch cluster with the plugin of your choice (this is for jvector)
cd opensearch-jvector-plugin
./gradlew clean run

In a separate tab you can run the benchmark:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements
# Run BM25 benchmark
python examples/benchmarking/opensearch_benchmark_bm25.py

# Run Neural Search benchmark
python examples/benchmarking/opensearch_benchmark_neural.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant