You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Abhishek Umarjikar (Jira)" <ji...@apache.org> on 2026/04/08 07:38:00 UTC

[jira] [Comment Edited] (SOLR-18175) A FieldExistsQuery IllegalStateException should result in HTTP 400 not 500 error

    [ https://issues.apache.org/jira/browse/SOLR-18175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18071866#comment-18071866 ] 

Abhishek Umarjikar edited comment on SOLR-18175 at 4/8/26 7:37 AM:
-------------------------------------------------------------------

The exception is created or thrown from lucene's code. In SolrQueryParserBase it starts with the parsing but i assume this should cause at rewrite so rewrite is at lucene level.
 
throw new IllegalStateException(buildErrorMsg(fieldInfo));

[~dsmiley] Can you confirm if this change we need to handle in solr?


was (Author: JIRAUSER309064):
The exception is created or thrown from lucene's code. In SolrQueryParserBase it starts with the parsing but i assume this should cause at rewrite so rewrite is at lucene level.
 
throw new IllegalStateException(buildErrorMsg(fieldInfo));

Can you confirm if this change we need to handle in solr?

> A FieldExistsQuery IllegalStateException should result in HTTP 400 not 500 error
> --------------------------------------------------------------------------------
>
>                 Key: SOLR-18175
>                 URL: https://issues.apache.org/jira/browse/SOLR-18175
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: David Smiley
>            Priority: Minor
>              Labels: newdev
>
> If you issue an existence query {{field:*}} yet that field does not support Lucene's {{FieldExistsQuery}}, FEQ.rewrite will throw IllegalStateException: 
> bq. FieldExistsQuery requires that the field indexes doc values, norms or vectors, but field 'foo' exists and indexes neither of these data structures
> Solr ultimately returns a HTTP 500, which is not what we want.  We want HTTP 400.  Note that I discovered this via a {{facet.query}} and have yet to check if it were to happen simply in a {{q}}.  The change likely involves modifying Solr {{FieldType.getExistenceQuery}} to throw an exception with the 400 code.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org