BTW, just wanted to say thanks again. It's working now.  I still don't
know how the values were reversed.  I believe I must have had a bug in
the code, but it wasn't visible to me.  I think netbeans did an
'install' with maven and put some bad code in the respository
directory and the test case was reading from there.

Anyway, thanks!  Now on to figuring out these "Explanation" classes.

On Jan 28, 2008 2:59 PM, Briggs <[EMAIL PROTECTED]> wrote:
> Cool, that worked, sort of.
>
> The customScore method that is overridden from CustomScoreQuery has a
> signature of:
>
> public float customScore(final int doc, final float subQueryScore,
> final float valSrcScore);
>
> The javadoc states that the valSrcScore is the value from the field of
> my ValueSourceQuery. But, the subQueryScore is actually my domainScore
> (6.83) and the valSrcScore (0.06762122)seems to be the the lucene
> subQueryScore.
>
> Odd. Though, I know these classe are experimental.  I must have
> something odd in there, but can't find it.
>
>
>
>
>
> On Jan 28, 2008 2:35 PM, Tom Emerson <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > In the constructor for your DomainCustomScoreQuery try calling
> >
> > setStrict(true);
> >
> > after invoking the superclass ctor. I think that will fix the problem you're
> > seeing.
> >
> >
> > On Jan 28, 2008 12:34 PM, Briggs <[EMAIL PROTECTED]> wrote:
> >
> >
> > > I am trying to 'muck' with document scores from Lucene.  I have
> > > certain business rules where I have a field named 'domainScore' within
> > > my index.  The 'domainScore' value is a float.  What I want to do is
> > > add this value to the document sub query score from the Lucene search.
> > >  I have implemented a CustomScoreQuery that receives an instance of a
> > > FieldScoreQuery which defines the fieldName 'domainScore' and the
> > > value being type float:
> > >
> > > //helper method that creates my query
> > > final Query query = createQuery("content", criteria);
> > >
> > > //create a new instance of my custom score query
> > > CustomScoreQuery customScoreQuery = new  DomainCustomScoreQuery(query,
> > >                new FieldScoreQuery("domainScore",
> > > FieldScoreQuery.Type.FLOAT));
> > >
> > >
> > > //this extends CustomScoreQuery
> > > public DomainCustomScoreQuery(final Query query, final
> > > ValueSourceQuery valueSourceQuery) {
> > >  super(query, valueSourceQuery);
> > > }
> > >
> > >  @Override
> > > public float customScore(final int doc, final float subQueryScore,
> > > final float valSrcScore) {
> > >
> > >  final float totalScore;
> > >
> > >  //shouldn't the valSrcScore be my 'domainScore' value?
> > >
> > >   //don't worry about the calculateScore, that is where I do some
> > > calculations based on the lucene document score and my domainScore
> > >  totalScore = calculateScore(subQueryScore, valSrcScore);
> > >
> > >  return totalScore;
> > > }
> > >
> > >
> > > So, that seems easy enough.  The issue I have is the valSrcScore is
> > > not the value of the 'domainScore' I have in the index.  For instance,
> > > my 'domainScore' field value for the document returned is '15.83'  but
> > > the 'valSrcScore' passed to the customScore method is '8.614598'.
> > > What am I missing?  The examples seem easy enough.
> > >
> > > Thanks for your time,
> > >
> > > Briggs.
> > >
> > >
> > > --
> > > "Conscious decisions by conscious minds are what make reality real"
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Tom Emerson
> > [EMAIL PROTECTED]
> > http://www.dreamersrealm.net/~tree
> >
>
>
>
> --
>
> "Conscious decisions by conscious minds are what make reality real"
>



-- 
"Conscious decisions by conscious minds are what make reality real"

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to