[
https://issues.apache.org/jira/browse/LUCENE-7064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15177947#comment-15177947
]
Luc Vanlerberghe commented on LUCENE-7064:
------------------------------------------
I updated the PR so modifying a Builder no longer affects already created
queries
I aligned the signatures of getTermArrays and getPositions with the ones in
PhraseQuery.
>From Adrien Grand:
{quote}
Actually I think returning a list is better: with arrays you need to perform a
deep copy if you want to make sure that the user cannot change the internal
state of the query. We could keep arrays internally and call
Collections.unmodifiableList(Arrays.asList(termArrays)) when returning the
terms to the user?
{quote}
For the getTermArrays case that would involve creating wrappers of wrappers
since it returns a two-dimensional array.
For now I just added a "Do not modify!" in the doc comment...
> Make MultiPhraseQuery immutable
> -------------------------------
>
> Key: LUCENE-7064
> URL: https://issues.apache.org/jira/browse/LUCENE-7064
> Project: Lucene - Core
> Issue Type: Improvement
> Components: core/search
> Reporter: Luc Vanlerberghe
> Priority: Minor
> Fix For: master, 6.0
>
>
> See LUCENE-6531
> Mutable queries are an issue for automatic filter caching since modifying a
> query after it has been put into the cache will corrupt the cache. We should
> make all queries immutable (up to the boost) to avoid this issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]