IN query not supported yet – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when you’re trying to use an “IN” query, which is not supported in Elasticsearch. Elasticsearch uses a different query DSL (Domain Specific Language) and doesn’t support SQL-like “IN” queries directly. To resolve this issue, you can use the “terms” query in Elasticsearch, which is equivalent to the “IN” query in SQL. Alternatively, you can use the “bool” query with multiple “match” queries to achieve the same result. Remember to always check the Elasticsearch documentation for the correct syntax and usage of its query DSL.

This guide will help you check for common problems that cause the log ” IN query not supported yet ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: parser, plugin, query.

Log Context

Log “IN query not supported yet” class name is ExpressionBuilder.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 case SqlBaseParser.BETWEEN:
 e = new Range(source; exp; expression(pCtx.lower); true; expression(pCtx.upper); true; zoneId);
 break;
 case SqlBaseParser.IN:
 if (pCtx.query() != null) {
 throw new ParsingException(source; "IN query not supported yet");
 }
 e = new In(source; exp; expressions(pCtx.valueExpression()); zoneId);
 break;
 case SqlBaseParser.LIKE:
 e = new Like(source; exp; visitPattern(pCtx.pattern()));

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?