You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Adrien Grand (Jira)" <ji...@apache.org> on 2020/08/12 12:41:00 UTC
[jira] [Commented] (LUCENE-9451) Sort.rewrite doesn't always return
this when unchanged
[ https://issues.apache.org/jira/browse/LUCENE-9451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17176317#comment-17176317 ]
Adrien Grand commented on LUCENE-9451:
--------------------------------------
If there's agreement that the contract of Sort#rewrite should be the same as Query#rewrite, I think we should fix IndexSearcher to call Sort#rewrite in a loop until it returns the same instance, which would have caught this.
> Sort.rewrite doesn't always return this when unchanged
> ------------------------------------------------------
>
> Key: LUCENE-9451
> URL: https://issues.apache.org/jira/browse/LUCENE-9451
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/search
> Affects Versions: 8.7
> Reporter: Mike Drob
> Assignee: Mike Drob
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Sort.rewrite doesn't always return {{this}} as advertised in the Javadoc even if the underlying fields are unchanged. This is because the comparison uses reference equality.
> There are two solutions we can do here, 1) switch from reference equality to object equality, and 2) fix some of the underlying sort fields to not create unnecessary objects.
> cc: [~jpountz] [~romseygeek]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org