lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: updating fieldNorms in mass
Date Tue, 14 Feb 2006 22:30:56 GMT
Chris Hostetter wrote:
> in the case where doc boosts and field boosts aren't used, it seems like
> it would be very easy to write a maintenance app that did something
> like...
> 
>    get instance of similarity based on input
>    foreach fieldName in input {
>        int[] termCounts = new int[maxDoc];
>        foreach Term in TermEnum for field {
>           foreach TermDoc on that Term {
>               termCounts[td.doc()]+=td.freq()
>           }
>        }
>        foreach doc {
>           IndexReader.setNorm(doc, fieldName, similarity.encodeNorm
>                   (similarity.lengthNorm(fieldName, termCounts[doc]))
>        }
>    }
> 
> 
> ...does anyone see anything wrong with the overall appraoch?

Looks good to me.

Doug

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


Mime
View raw message