[ 
https://issues.apache.org/jira/browse/LUCENE-6369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Adrien Grand updated LUCENE-6369:
---------------------------------
    Attachment: immutable_queries.patch

Here is a diff of what I have been exploring with immutable queries. The patch 
does not compile, even just migrating lucene/core would be a lot of work given 
how much we have and use mutable queries everywhere. However it should give an 
idea of what we could have in terms of API. For instance BooleanQuery does not 
have any setters anymore besides setBoost and the constructor looks like this: 
new BooleanQuery(boolean disableCoord, int minShouldMatch, BooleanClause... 
clauses).

I would be happy to do the work but it would certainly take several days of 
work so I would like to make sure nobody has concerns before starting. For now 
I suggest to just focus on trunk and not worry about bw compat, we can discuss 
it once we agree how it should look like on trunk. Feedback is highly welcome!

> Make queries more defensive and clone deeply
> --------------------------------------------
>
>                 Key: LUCENE-6369
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6369
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>             Fix For: 5.1
>
>         Attachments: LUCENE-6369.patch, immutable_queries.patch
>
>
> It is very important for the query cache that queries be either immutable or 
> clone deeply so that they cannot change after having been put into the cache.
> There are three issues that need to be addressed:
>  - mutable queries such as boolean or phrase queries do not clone deeply
>  - queries that wrap mutable objects such as TermQuery's term
>  - filters inherit Query's default clone impl which is not enough in most 
> cases



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to