lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Elschot (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-6328) Make Filter.clone and Filter.setBoost throw an UnsupportedOperationException
Date Sat, 07 Mar 2015 10:24:38 GMT

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

Paul Elschot updated LUCENE-6328:
---------------------------------
    Attachment: queryextendsfilter-20150307.patch

This patch makes Query extend Filter, it is against trunk of 12 Feb 2015 just before LUCENE-1518
(Filter extends Query).
The patch only shows the direction I meant, compilation of other code still fails.
It introduces IndexDocIdSet as a superclass of Weight.

> Make Filter.clone and Filter.setBoost throw an UnsupportedOperationException
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-6328
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6328
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>             Fix For: Trunk, 5.1
>
>         Attachments: LUCENE-6328.patch, queryextendsfilter-20150307.patch
>
>
> The rewrite process uses a combination of calls to clone() and setBoost(boost) in order
to rewrite queries. This is a bit weird for filters given that they were not originally designed
to care about scoring.
> Using a filter directly as a query fails unit tests today since filters do not pass the
QueryUtils checks: it is expected that cloning and changing the boost results in an instance
which is unequal. However existing filters do not take into account the getBoost() parameter
inherited from Query so this test fails.
> I think it would be less error-prone to throw an UnsupportedOperationException for clone()
and setBoost() on filters and disable the check in QueryUtils for filters.
> In order to keep rewriting working, filters could rewrite to a CSQ around themselves
so that clone() and setBoost() would be called on the CSQ.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message