You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by bu...@apache.org on 2004/02/06 12:46:29 UTC

DO NOT REPLY [Bug 26716] New: - [Patch] PerQuery Similarity Access

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26716>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26716

[Patch] PerQuery Similarity  Access

           Summary: [Patch] PerQuery Similarity  Access
           Product: Lucene
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Search
        AssignedTo: lucene-dev@jakarta.apache.org
        ReportedBy: julien.nioche@lingway.com


Here's the patch to implement the per-query Similarity access

Doug described it like that : 
*********************************************************************
Before that, Similarity was global: there was only one implementation.
I could think of cases where it might make sense to have it per-query,
but that also seemed too fine-grained, so I opted to make it
per-searcher.  But perhaps it really *should* be possible to specify a
different Similarity implementation for different queries.

Here's a proposal.  We add a method to Query as follows:

   public Query#getSimilarity(Searcher searcher) {
      return searcher.getSimilarity();
   }

Then change all of the Weight and Scorer code to call this in place of
Searcher#getSimilarity().  This permits one to subclass a Query class so
that it can specify it's own Similarity implementation, perhaps one that
delegates through that of the Searcher.
*********************************************************************

With that patch the Scorer objets are not modified because they access their own
Similarity field which is specified by the Weight objects.

This patch passes all junit tests

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