NullPointerException when using simpleQueryString() on non-analyzed, non-normalized fields

Description

When use:

if (searchFullText != null) {
select = scope.predicate().simpleQueryString()
.field("shoppingName")
.matching(searchFullText)
.defaultOperator(BooleanOperator.AND);
} else {
select = scope.predicate().matchAll();
}

SearchQuery<Assortment> query = session.search(scope)
.where((f) -> select)
.sort(sort.toSort()).toQuery();

I have an exception only for simpleQueryString, for matchAll it's fine.

Exception: null: java.lang.NullPointerException
at org.apache.lucene.util.QueryBuilder.createFieldQuery(QueryBuilder.java:239)
at org.apache.lucene.util.QueryBuilder.createBooleanQuery(QueryBuilder.java:96)
at org.hibernate.search.backend.lucene.lowlevel.query.impl.FieldContextSimpleQueryParser.newDefaultQuery(FieldContextSimpleQueryParser.java:50)
at org.apache.lucene.queryparser.simple.SimpleQueryParser.consumeToken(SimpleQueryParser.java:415)
at org.apache.lucene.queryparser.simple.SimpleQueryParser.parseSubQuery(SimpleQueryParser.java:216)
at org.apache.lucene.queryparser.simple.SimpleQueryParser.parse(SimpleQueryParser.java:156)
at org.hibernate.search.backend.lucene.search.predicate.impl.LuceneSimpleQueryStringPredicateBuilder.doBuild(LuceneSimpleQueryStringPredicateBuilder.java:107)
at org.hibernate.search.backend.lucene.search.predicate.impl.AbstractLuceneSearchPredicateBuilder.build(AbstractLuceneSearchPredicateBuilder.java:40)

Environment

wildflay

Assignee

Yoann Rodière

Reporter

Waldemar Kłaczyński

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Major
Configure