Skip to content

Commit

Permalink
upgrades for 2.5.0: new versions of things, add some docs, upgrade gr…
Browse files Browse the repository at this point in the history
…adlew
  • Loading branch information
gsingers committed Jan 31, 2023
1 parent 332cade commit 53a206c
Show file tree
Hide file tree
Showing 18 changed files with 214 additions and 142 deletions.
45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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 1.x. Please refer to official documentation of [Elasticsearch Learning to Rank](http://elasticsearch-learning-to-rank.readthedocs.io) for usage.
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 [Elasticsearch Learning to Rank](http://elasticsearch-learning-to-rank.readthedocs.io) 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.

Expand All @@ -9,14 +9,15 @@ The OpenSearch Learning to Rank plugin uses machine learning to improve search r

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` |
| 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/releases/download/2.5.0/ltr-2.1.0-os2.5.0.zip` |


(It's expected you'll confirm some security exceptions, you can pass `-b` to `opensearch-plugin` to automatically install)
Expand Down Expand Up @@ -59,14 +60,25 @@ Tests with failures:
```


# Building
# Development

To build, you need to disable the Java security manager

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

# Upgrading the OpenSearch Versions

# OpenSearch with Learning to Rank Docker Image
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
4. Test the docker image, per below.

## Development Notes



# Docker

A custom image of [OpenSearch](https://hub.docker.com/r/opensearchproject/opensearch) with the [OpenSearch Learning to Rank plugin](https://github.com/gsingers/opensearch-learning-to-rank-base) installed.

Expand All @@ -82,13 +94,13 @@ Note, we are use Docker ARGs to pass through variables via the --build-arg. All

### Using local artifacts

docker build -f docker/local.Dockerfile
docker build -f docker/local.Dockerfile .

### Using official releases, built locally

#### Using defaults

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

#### From Versions

Expand All @@ -104,4 +116,7 @@ Note, we are use Docker ARGs to pass through variables via the --build-arg. All

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
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" YOUR/IMAGE_NAME:latest



6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG opensearch_version=2.2.1
ARG opensearch_version=2.5.0

FROM opensearchproject/opensearch:${opensearch_version}
ARG opensearch_version=2.2.1
ARG ltrversion=2.0.0rc1
ARG opensearch_version=2.5.0
ARG ltrversion=2.1.0
RUN /usr/share/opensearch/bin/opensearch-plugin install -b https://github.com/gsingers/opensearch-learning-to-rank-base/releases/download/release-v${ltrversion}/ltr-plugin-v${ltrversion}.zip


Expand Down
6 changes: 3 additions & 3 deletions docker/local.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Build an image from a local distribution

ARG opensearch_version=2.2.1
ARG opensearch_version=2.5.0
FROM opensearchproject/opensearch:${opensearch_version}
ARG ltrversion=2.0.0
ARG opensearch_version=2.2.1
ARG ltrversion=2.1.0
ARG opensearch_version=2.5.0
ARG zip_file=ltr-${ltrversion}-os${opensearch_version}.zip
ARG plugin_file=/usr/share/opensearch/${zip_file}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ltrVersion = 2.0.0
opensearchVersion = 2.2.1
luceneVersion = 9.3.0
ow2Version = 8.0.1
antlrVersion=4.5.1-1
ltrVersion = 2.1.0
opensearchVersion = 2.5.0
luceneVersion = 9.4.2
ow2Version = 9.4
antlrVersion=4.9.3
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 53a206c

Please sign in to comment.