Find a file
opensearch-trigger-bot[bot] 6b9ef9b8fe
[AUTO] Increment version to 3.6.0-SNAPSHOT (#287)
Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com>
Co-authored-by: opensearch-ci-bot <opensearch-infra@amazon.com>
2026-03-02 11:42:35 -08:00
.github Reduce the required coverage until we can improve it (#258) 2025-11-26 09:31:04 -08:00
demo/xgboost-demo feat: added demo files from elasticsearch repo to opensearch repo (#48) 2024-10-15 09:42:52 -04:00
docker Setting versions to 2.17.1 (#56) 2024-10-31 09:06:58 -04:00
gradle/wrapper Upgrade Gradle to 9.2.0 (#263) 2025-11-25 11:36:33 -05:00
licenses Support integTests against an external test cluster with security pluin enabled 2025-01-27 17:31:54 -08:00
release-notes Add 3.4.0 release note (#280) 2025-12-11 18:18:13 -05:00
sample_models Produce sample model scripts for each supported model 2017-03-09 14:16:30 -08:00
scripts Modified build scripts to onboard ltr to OpenSearch 2025-01-13 17:36:48 -08:00
src Fix LoggingSearchExtBuilder.toXContent missing field name (#290) 2026-02-19 11:52:38 -08:00
.eclipseformat.xml Add Spotless to build 2025-01-27 17:41:20 -08:00
.gitignore Support integTests against an external test cluster with security pluin enabled 2025-01-27 17:31:54 -08:00
.java-version Modified build scripts to onboard ltr to OpenSearch 2025-01-13 17:36:48 -08:00
.whitesource Add .whitesource configuration file 2023-06-13 17:06:58 +00:00
ADMIN.md adding standard OpenSearch issue templates and ADMIN/MAINTAINERS/CODEOWNERS list 2023-06-14 10:19:10 -04:00
build.gradle [AUTO] Increment version to 3.6.0-SNAPSHOT (#287) 2026-03-02 11:42:35 -08:00
CODE_OF_CONDUCT.md adding standard opensearch code of conduct 2023-06-15 11:21:07 -04:00
CONTRIBUTING.md Fix some docs that were still referring to ES and old documentation website (#66) 2024-11-08 17:38:24 -05:00
gradle.properties Modified build scripts to onboard ltr to OpenSearch 2025-01-13 17:36:48 -08:00
gradlew Upgrade Gradle to 9.2.0 (#263) 2025-11-25 11:36:33 -05:00
gradlew.bat Upgrade Gradle to 9.2.0 (#263) 2025-11-25 11:36:33 -05:00
KNOWN_ISSUES.md Ported code to Opendistro 1.0.0 2021-08-24 21:39:52 +02:00
LICENSE.txt Adds Lucene learning to rank query; begins test 2016-12-24 22:17:36 -05:00
MAINTAINERS.md Adding Yaliang Wu, Jing Zhang, and Rithin Pullela as maintainers 2025-01-16 13:06:11 -05:00
NOTICE.txt Add required notice 2017-09-30 15:29:20 -04:00
README.md Fix some docs that were still referring to ES and old documentation website (#66) 2024-11-08 17:38:24 -05:00
settings.gradle Upgrade Gradle to 9.2.0 (#263) 2025-11-25 11:36:33 -05:00

Important Notice

This is a fork of https://github.com/o19s/elasticsearch-learning-to-rank to work with OpenSearch. It's a rewrite of some parts to be able to work with OpenSearch. Please refer to official documentation of OpenSearch Learning to Rank for usage.

The OpenSearch Learning to Rank plugin uses machine learning to improve search relevance ranking. The original Elasticsearch LTR plugin powers search at places like Wikimedia Foundation and Snagajob.

Installing

To install, you'd run a command like this but replacing with the appropriate prebuilt version zip:

OS Command
1.0.0 bin/opensearch-plugin install https://github.com/aparo/opensearch-learning-to-rank/releases/download/1.0.0/ltr-1.5.4-os1.0.0.zip
1.1.0 bin/opensearch-plugin install https://github.com/aparo/opensearch-learning-to-rank/releases/download/1.1.0/ltr-1.5.4-os1.1.0.zip
1.2.0 bin/opensearch-plugin install https://github.com/aparo/opensearch-learning-to-rank/releases/download/1.2.0/ltr-1.5.4-os1.2.0.zip
1.2.2 bin/opensearch-plugin install https://github.com/aparo/opensearch-learning-to-rank/releases/download/1.2.2/ltr-1.5.4-os1.2.2.zip
1.2.3 bin/opensearch-plugin install https://github.com/aparo/opensearch-learning-to-rank/releases/download/1.2.3/ltr-1.5.4-os1.2.3.zip
2.2.1 bin/opensearch-plugin install https://github.com/aparo/opensearch-learning-to-rank/releases/download/2.2.1/ltr-2.0.0-os2.2.1.zip
2.5.0 bin/opensearch-plugin install https://github.com/gsingers/opensearch-learning-to-rank-base/releases/download/release-v2.1.0/ltr-plugin-v2.1.0.zip
2.11.1 bin/opensearch-plugin install https://github.com/opensearch-project/opensearch-learning-to-rank-base/releases/download/release-v2.11.1/ltr-plugin-v2.11.1.zip
2.17.1 bin/opensearch-plugin install https://github.com/opensearch-project/opensearch-learning-to-rank-base/releases/download/2.17.1/ltr-2.17.1-os2.17.1.zip

(It's expected you'll confirm some security exceptions, you can pass -b to opensearch-plugin to automatically install)

If you already are running OpenSearch, don't forget to restart!

Releases

Releases can be found at https://github.com/opensearch-project/opensearch-learning-to-rank-base/releases.

Releasing/Packaging

Releases are done through GitHub Workflows (see .github/workflows in the root directory) on an as needed basis. If you do ./gradlew build as per above under building, it will build all the artifacts that are in the release.

Development

To build, you need to disable the Java security manager

./gradlew -Dtests.security.manager=false clean build

Upgrading the OpenSearch Versions

  1. Edit gradle.properties to have the appropriate versions (it's often easiest to go download the latest tarball from OpenSearch and simply check the versions that ship) and to increment the version of this plugin
  2. Build and test as above
  3. Update this README with the version info in the table above
  4. Upgrade the Docker file versions in the docker directory
  5. Test the docker image, per below.

Development Notes

Docker

A custom image of OpenSearch with the OpenSearch Learning to Rank plugin installed.

This image was created for the Search with Machine Learning course and Search Fundamentals taught by Grant Ingersoll and Daniel Tunkelang.

See the OpenSearch Learning to Rank documentation for details on how to use.

Building

Building the docker image is triggered via the GitHub Actions workflows automatically (for releases) or via the commands below.

Note, we are use Docker ARGs to pass through variables via the --build-arg. All args have defaults

Using local artifacts

docker build -f docker/local.Dockerfile .

Using official releases, built locally

Using defaults

docker build -f docker/Dockerfile --tag=YOUR/IMAGE_NAME .

From Versions

docker build -f docker/Dockerfile --tag=YOUR/IMAGE_NAME --build-arg opensearch_version=2.2.1 --build-arg ltrversion=2.0.0 .

From a URL

docker build -f docker/Dockerfile --tag=YOUR/IMAGE_NAME --build-arg plugin="https://github.com/opensearch-project/opensearch-learning-to-rank-base/releases/download/release-test-release/ltr-plugin-test-release.zip" .

Running the docker image

See the OpenSearch docs for official instructions, but this should work:

docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" YOUR/IMAGE_NAME:latest

Publishing the Docker Image

To publish the Docker image to Docker Hub, you need to kick off the Docker action workflow:

gh workflow run .github/workflows/docker.yml