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

Opster Team

August-23, Version: 6.8-8.9

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

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.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

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?