lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] Commented: (LUCENE-1808) make Query.createWeight public (or add back Query.createQueryWeight())
Date Sat, 15 Aug 2009 22:11:14 GMT


Shai Erera commented on LUCENE-1808:

I thought that's partly we took care of here:

True, if someone overrides createWeight (he ought to) and call it specifically, createQueryWeight
won't be called. But then, all of our code will call createQueryWeight. And if we deprecate
createWeight, those who call it directly will need to move to createQueryWeight, so I think
we should be fine?

Anyway, I may not think too clear at this hour (1 AM), so if I misunderstood something, I'll
read it again in the morning.

> make Query.createWeight public (or add back Query.createQueryWeight())
> ----------------------------------------------------------------------
>                 Key: LUCENE-1808
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Query/Scoring
>    Affects Versions: 2.9
>            Reporter: Tim Smith
>            Assignee: Mark Miller
> Now that the QueryWeight class has been removed, the public QueryWeight createQueryWeight()
method on Query was also removed
> i have cases where i want to create a weight for a sub query (outside of the
package) and i don't want the weight normalized (think BooleanQuery outside of the
> in order to do this, i have to create a static Utils class inside, pass
in the Query and searcher, and have the static method call the protected createWeight method
> this should not be necessary
> This could be fixed in one of 2 ways:
> 1. make createWeight() public on Query (breaks back compat)
> 2. add the following method:
> {code}
> public Weight createQueryWeight(Searcher searcher) throws IOException {
>   return createWeight(searcher);
> }
> {code}
> createWeight(Searcher) should then be deprectated in favor of the publicly accessible

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message