Treat BooleanQuery as an immutable Query

Description

BooleanQuery has been used traditionally like this:

1 2 BooleanQuery q = new BooleanQuery(); q.add( otherQuery, Occur.SOMETHING );

But now the no-arguments constructor is deprecated, and adding clauses to the instance is deprecated too.

All our code needs to be updated to use org.apache.lucene.search.BooleanQuery.Builder instead, as in Lucene 6 all queries become immutable. BooleanQuery is used in many areas, including tests.

Environment

None

Status

Assignee

Mincong Huang

Reporter

Sanne Grinovero

Labels

None

Suitable for new contributors

Yes, likely

Pull Request

None

Feedback Requested

None

Fix versions

Priority

Major