Mailing List Archive

can some access modifiers in org.apache.lucene.search be changed/"opened up"
I don't have CVS access and prefer the safety of not having it :) so I
don't
hose things up but wanted to suggest that a couple of classes/method be
slightly changed so that the modifiers go from the implicit
"package-private"
to public or protected.

In an earlier release I wanted to add a "SubstringQuery" that matches
search
terms that are substrings of words in the doc, so "framework" matches
"frameworks",
"singletonframeworks", and "framework" itself. My impl changed the boost
based
on how many extra chars the word in the doc has, so more exact matches
returned
higher scores.

I understand this is expensive but sometimes this is what a user wants.

I also see there's now a WildcardQuery that may do the job now for this
exact example
(via searching for "*framework*" I guess) but that's beside the point
-this refers
to all Query additions.

Problem is that on the org.apache.lucene.search pkg, some of the defs
require that any Query I want to write *has* to be in that pkg. Fine for
official additions to the code base, bad for experiments/decoupled
contributions.

Proposed solution is to change a couple of decls in Scorer and Query:

Scorer.java
make score() public

Query.java
make all methods public or protected (normalize,
sumOfSquaredWeights,prepare)

By doing this other Queries can be added w/o having to be in the above
package.
Nothing can possibly break by doing it :) and I don't think this is a
design/encapsulation
flaw to expose these.

So if there's no major objections by others or misunderstandings on my
part
could the powers of be make the above decl changes?

Thanks,
Dave




--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
Re: can some access modifiers in org.apache.lucene.search be changed/"opened up" [ In reply to ]
+1 on this. I was going to propose the same change by waited until the
release went out.
While we are at this, can we also make the
org.apache.lucene.analysis.PorterStemmer class public again? It is
useful in case you want to utilize stemming in the same application
where Lucene is being used. If the counterargument is that this confuses
the purpose of the analysis package, perhaps PorterStemmer can be moved
to util?

Dmitry


Spencer, Dave wrote:

>Proposed solution is to change a couple of decls in Scorer and Query:
>
> Scorer.java
> make score() public
>
> Query.java
> make all methods public or protected (normalize,
>sumOfSquaredWeights,prepare)
>
>By doing this other Queries can be added w/o having to be in the above
>package.
>Nothing can possibly break by doing it :) and I don't think this is a
>design/encapsulation
>flaw to expose these.
>
>So if there's no major objections by others or misunderstandings on my
>part
>could the powers of be make the above decl changes?
>
>Thanks,
> Dave
>



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