Skip to content

Commit

Permalink
Update build to java 21 (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
aprudhomme authored May 30, 2024
1 parent 7f900df commit c9d24f4
Show file tree
Hide file tree
Showing 9 changed files with 2,849 additions and 2,120 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['17', '21']
java: ['21']
name: Java ${{ matrix.Java }} build
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN add-apt-repository -y 'deb https://apt.corretto.aws stable main'
# For some reason, needs to be run again for the repo to be usable
RUN add-apt-repository -y 'deb https://apt.corretto.aws stable main'
RUN apt-get update && \
apt-get install -y java-17-amazon-corretto-jdk
apt-get install -y java-21-amazon-corretto-jdk

RUN mkdir /usr/app/
COPY . /user/app/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In the home directory.
./gradlew clean installDist test
```

Note: This code has been tested on *Java17*
Note: This code has been tested on *Java21*


# Run gRPC Server
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ repositories {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

allprojects {
Expand Down
4 changes: 2 additions & 2 deletions example-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ repositories {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

group 'com.yelp.nrtsearch.plugins'
Expand Down
2 changes: 1 addition & 1 deletion grpc-gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN add-apt-repository -y 'deb https://apt.corretto.aws stable main'
# For some reason, needs to be run again for the repo to be usable
RUN add-apt-repository -y 'deb https://apt.corretto.aws stable main'
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y java-17-amazon-corretto-jdk
DEBIAN_FRONTEND=noninteractive apt-get install -y java-21-amazon-corretto-jdk

# Install protoc
ENV PROTOC_VERSION=3.11.4
Expand Down
703 changes: 354 additions & 349 deletions grpc-gateway/luceneserver.pb.go

Large diffs are not rendered by default.

119 changes: 117 additions & 2 deletions grpc-gateway/luceneserver.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,20 @@
}
}
},
"FuzzyParamsAutoFuzziness": {
"type": "object",
"properties": {
"low": {
"type": "integer",
"format": "int32"
},
"high": {
"type": "integer",
"format": "int32"
}
},
"title": "Optional low and high values for auto fuzziness. Defaults to low: 3 and high: 6 if both are unset. Valid values are low \u003e= 0 and low \u003c high"
},
"HighlightSettings": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1775,6 +1789,12 @@
"vectorValue": {
"$ref": "#/definitions/FieldValueVector",
"title": "Value for VECTOR FieldType"
},
"listValue": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
Expand All @@ -1790,6 +1810,15 @@
}
}
},
"MatchPhraseQueryZeroTerms": {
"type": "string",
"enum": [
"NONE_ZERO_TERMS",
"ALL_ZERO_TERMS"
],
"default": "NONE_ZERO_TERMS",
"description": "Zero Terms options when analyzer removes all tokens.\n\n - NONE_ZERO_TERMS: No documents are returned if the analyzer removes all tokens.\n - ALL_ZERO_TERMS: All documents are returned if the analyzer removes all tokens."
},
"MultiFunctionScoreQueryBoostMode": {
"type": "string",
"enum": [
Expand All @@ -1801,6 +1830,46 @@
"description": "- BOOST_MODE_MULTIPLY: Multiply scores together\n - BOOST_MODE_SUM: Add scores together\n - BOOST_MODE_REPLACE: Ignore the query score, and use the function score only",
"title": "How to combine final function score with query score"
},
"MultiFunctionScoreQueryDecayFunction": {
"type": "object",
"properties": {
"fieldName": {
"type": "string",
"title": "Document field name to use"
},
"decayType": {
"$ref": "#/definitions/MultiFunctionScoreQueryDecayType",
"title": "Type of decay function to apply"
},
"geoPoint": {
"$ref": "#/definitions/typeLatLng"
},
"scale": {
"type": "string",
"title": "Currently only distance based scale and offset units are supported\nDistance from origin + offset at which computed score will be equal to decay. Scale should be distance, unit (m, km, mi) with space is optional. Default unit will be meters. Ex: \"10\", \"15 km\", \"5 m\", \"7 mi\""
},
"offset": {
"type": "string",
"title": "Compute decay function for docs with a distance greater than offset, will be 0.0 if none is set. Offset should be distance, unit (m, km, mi) with space is optional. Default unit will be meters. Ex: \"10\", \"15 km\", \"5 m\", \"7 mi\""
},
"decay": {
"type": "number",
"format": "float",
"title": "Defines decay rate for scoring. Should be between (0, 1)"
}
},
"title": "Apply decay function to docs"
},
"MultiFunctionScoreQueryDecayType": {
"type": "string",
"enum": [
"DECAY_TYPE_EXPONENTIAL",
"DECAY_TYPE_LINEAR",
"DECAY_TYPE_GUASSIAN"
],
"default": "DECAY_TYPE_EXPONENTIAL",
"title": "- DECAY_TYPE_EXPONENTIAL: Exponential decay function\n - DECAY_TYPE_LINEAR: Linear decay function\n - DECAY_TYPE_GUASSIAN: Gaussian decay function"
},
"MultiFunctionScoreQueryFilterFunction": {
"type": "object",
"properties": {
Expand All @@ -1816,6 +1885,10 @@
"script": {
"$ref": "#/definitions/luceneserverScript",
"title": "Produce score with score script definition"
},
"decayFunction": {
"$ref": "#/definitions/MultiFunctionScoreQueryDecayFunction",
"title": "Produce score with a decay function"
}
},
"title": "Function to produce a weighted value"
Expand Down Expand Up @@ -2494,6 +2567,10 @@
"$ref": "#/definitions/luceneserverMaxCollector",
"description": "Collector for finding a max double value from collected documents."
},
"min": {
"$ref": "#/definitions/luceneserverMinCollector",
"description": "Collector for finding a min double value from collected documents."
},
"nestedCollectors": {
"type": "object",
"additionalProperties": {
Expand Down Expand Up @@ -3185,10 +3262,11 @@
"POLYGON",
"OBJECT",
"VECTOR",
"CONTEXT_SUGGEST"
"CONTEXT_SUGGEST",
"RUNTIME"
],
"default": "ATOM",
"description": "- VIRTUAL: TODO name this \"dynamic\" instead of \"virtual\"?\n - INTERNAL: TODO need tests for internal:\n - VECTOR: List of float values",
"description": "- VIRTUAL: TODO name this \"dynamic\" instead of \"virtual\"?\n - INTERNAL: TODO need tests for internal:\n - VECTOR: List of float values\n - RUNTIME: Runtime fields",
"title": "Type of the field"
},
"luceneserverFileMetadata": {
Expand Down Expand Up @@ -3398,6 +3476,9 @@
},
"transpositions": {
"type": "boolean"
},
"auto": {
"$ref": "#/definitions/FuzzyParamsAutoFuzziness"
}
}
},
Expand Down Expand Up @@ -3974,6 +4055,9 @@
},
"analyzer": {
"$ref": "#/definitions/luceneserverAnalyzer"
},
"zeroTermsQuery": {
"$ref": "#/definitions/MatchPhraseQueryZeroTerms"
}
},
"description": "A query that analyzes the text before finding matching documents. The tokens resulting from the analysis are combined into a PhraseQuery."
Expand Down Expand Up @@ -4013,6 +4097,16 @@
},
"description": "Definition of collector to find a max double value over documents. Currently only allows for script based value production."
},
"luceneserverMinCollector": {
"type": "object",
"properties": {
"script": {
"$ref": "#/definitions/luceneserverScript",
"title": "Script to produce a double value"
}
},
"description": "Definition of collector to find a min double value over documents. Currently only allows for script based value production."
},
"luceneserverMode": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -4589,6 +4683,20 @@
"description": "- CONSTANT_SCORE: Uses the CONSTANT_SCORE_BOOLEAN method for fewer matching terms. Otherwise, this method finds all matching terms in sequence and returns matching documents using a bit set.\n - CONSTANT_SCORE_BOOLEAN: This method changes the original query to a BooleanQuery, containing a SHOULD clause and TermQuery for each matching term.\n - SCORING_BOOLEAN: This method changes the original query to a BooleanQuery, containing a SHOULD clause and TermQuery for each matching term. Calculates the relevance score for each matching document.\n - TOP_TERMS_BLENDED_FREQS: This method changes the original query to a BooleanQuery, containing a SHOULD clause and TermQuery for each matching term. Calculates a relevance score for each matching document as if all terms had the same frequency, the maximum frequency of all matching terms. The final BooleanQuery query only includes Term queries for the top N (specified separately) scoring terms.\n - TOP_TERMS_BOOST: This method changes the original query to a BooleanQuery, containing a SHOULD clause and TermQuery for each matching term. Assigns each matching document a relevance score equal to the boost parameter. The final BooleanQuery query only includes Term queries for the top N (specified separately) terms.\n - TOP_TERMS: This method changes the original query to a BooleanQuery, containing a SHOULD clause and TermQuery for each matching term. Calculates a relevance score for each matching document. The final BooleanQuery query only includes Term queries for the top N (specified separately) scoring terms.",
"title": "Method used to rewrite a MultiTermQuery"
},
"luceneserverRuntimeField": {
"type": "object",
"properties": {
"script": {
"$ref": "#/definitions/luceneserverScript",
"description": "Script defining this field's values."
},
"name": {
"type": "string",
"description": "Runtime field's name. Must be different from registered fields and any other runtime fields."
}
},
"title": "Runtime field used during search"
},
"luceneserverScript": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -4724,6 +4832,13 @@
"$ref": "#/definitions/luceneserverInnerHit"
},
"title": "Search nested object fields for each hit"
},
"runtimeFields": {
"type": "array",
"items": {
"$ref": "#/definitions/luceneserverRuntimeField"
},
"title": "Defines runtime fields for this query"
}
}
},
Expand Down
Loading

0 comments on commit c9d24f4

Please sign in to comment.