Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Fixing query attributes null.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed May 29, 2024
1 parent 5103e23 commit a7407f2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM opensearchproject/opensearch:2.14.0

COPY ./build/distributions/opensearch-ubi-0.0.11-os2.14.0.zip /tmp/
COPY ./build/distributions/opensearch-ubi-0.0.12.1-os2.14.0.zip /tmp/

RUN /usr/share/opensearch/bin/opensearch-plugin install file:/tmp/opensearch-ubi-0.0.11-os2.14.0.zip
RUN /usr/share/opensearch/bin/opensearch-plugin install file:/tmp/opensearch-ubi-0.0.12.1-os2.14.0.zip
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bin/opensearch-plugin install file:/opensearch-ubi-1.0.0-os2.14.0.zip
To create the UBI indexes called `ubi_queries` and `ubi_events`, send a query to an OpenSearch index with the `ubi` query block added:

```
curl -s http://localhost:9200/your-index/_search -H "Content-Type: application/json" -d'
curl -s http://localhost:9200/ecommerce/_search -H "Content-Type: application/json" -d'
{
"ext": {
"ubi": {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
opensearchVersion = 2.14.0
ubiVersion = 0.0.12
ubiVersion = 0.0.12.1
4 changes: 4 additions & 0 deletions src/main/java/org/opensearch/ubi/ext/UbiParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.opensearch.search.SearchExtBuilder;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -239,6 +240,9 @@ public void setUserQuery(String userQuery) {
* @return A map of attributes.
*/
public Map<String, String> getQueryAttributes() {
if(queryAttributes == null) {
queryAttributes = new HashMap<>();
}
return queryAttributes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
index: ubi_queries
body: {}

- match: {count : 1}
- match: {count : 2}

0 comments on commit a7407f2

Please sign in to comment.