lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <rcm...@gmail.com>
Subject Re: Problem modifying Similarity class to work with lucene 3.1.0
Date Tue, 03 May 2011 14:49:37 GMT
On Tue, May 3, 2011 at 10:29 AM, Paul Taylor <paul_t100@fastmail.fm> wrote:
> I assume this would be the correct way to fix the code for 3.1.0
>

Yes, thats correct.

> public float computeNorm(String field, FieldInvertState state) {
>
>
>        //This will match both artist and label aliases and is applicable to
> both, didn't use the constant
>        //ArtistIndexField.ALIAS because that would be confusing
>        if (field.equals("alias")) {
>            return state.getBoost() * 0.578f; //Same result as normal calc if
> field had three terms the most common scenario
>        }
>        else
>        {
>            return super.computeNorm(field,state);
>        }
>    }
>
>
> Paul
>

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


Mime
View raw message