Elasticsearch: Adding arraylist in QueryBuilders.termsQuery() throws error Elasticsearch: Adding arraylist in QueryBuilders.termsQuery() throws error elasticsearch elasticsearch

Elasticsearch: Adding arraylist in QueryBuilders.termsQuery() throws error


As shown in the stacktrace, it is because of the Number Format Exception. You need to send list of Integer which is the type of id field instead of passing List<Replacement> as mentioned in your code.

Instead of creating an object Of List<Replacement>, create a List and pass that list.

Hope it works for you.