How to Write OpenSearch Multi-Match Query in Java

Here we will see how to write OpenSearch multi-match query using Java SDK. OpenSearch multi-match query is supported for String type fields only. We will write code in Java to implement that. Also, we will write some Java code which can be used to emulate multi-match query for non-String data type fields like Integer, Long, … Read more

How to Instantiate OpenSearch Client in Java

Here we will learn how to create OpenSearch client using Java SDK. We will see how to connect to an OpenSearch cluster from a Java application for both AWS & non-AWS environments. OpenSearchClient for non-AWS environment: For a Gradle project, we need to add below dependencies in build.gradle file. For maven project, we would need … Read more

Connecting to LocalStack OpenSearch from localhost Docker container

As I mentioned earlier, I use LocalStack to emulate AWS services during development phase. It works more or less well. Recently I faced a problem with LocalStack OpenSearch instance. I created one OpenSearch cluster using LocalStack. My LocalStack is installed via docker-compose file & it runs in a container. Now I have developed a Java … Read more

How to Mock Java Enum or Final Class Without PowerMock

First things first. Here we won’t be discussing mocking of Java enum or final class using PowerMock framework. That is already discussed in tons of places & one of the main reason why people tend to use PowerMock.Here we will be discussing mocking of enum or final classes with Mockito framework only. The feature has … Read more

How to Resolve Kubernetes Autoscaler Error “Unable to read all metrics”

I was exploring GKE or Google Kubernetes Engine recently. Google Cloud has pretty good UI interface where you can deploy workloads & services without having to define your own YAML file. You can completely skip kubectl command line if you are starting as a Kubernetes beginner. You can just follow the UI steps. UI is … Read more