lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <>
Subject [jira] [Commented] (LUCENE-6570) Make BooleanQuery immutable
Date Tue, 16 Jun 2015 11:57:02 GMT


Adrien Grand commented on LUCENE-6570:

I can defer, the reason I was trying to avoid it is that it will make the migration slightly

bq. less lines of code != easier to read.

It's different but not completely unrelated. Also my main point was about making BooleanQuery
easier to use for common use-cases.

> Make BooleanQuery immutable
> ---------------------------
>                 Key: LUCENE-6570
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
> In the same spirit as LUCENE-6531 for the PhraseQuery, we should make BooleanQuery immutable.
> The plan is the following:
>  - create BooleanQuery.Builder with the same setters as BooleanQuery today (except setBoost)
and a build() method that returns a BooleanQuery
>  - remove setters from BooleanQuery (except setBoost)
> I would also like to add some static utility methods for common use-cases of this query,
for instance:
>  - static BooleanQuery disjunction(Query... queries) to create a disjunction
>  - static BooleanQuery conjunction(Query... queries) to create a conjunction
>  - static BooleanQuery filtered(Query query, Query... filters) to create a filtered query
> Hopefully this will help keep tests not too verbose, and the latter will also help with
the FilteredQuery derecation/removal.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message