You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Phan The Dai <th...@gmail.com> on 2010/01/29 17:27:21 UTC

How further reward documents matching more query terms?

"When searching with a query as a multi term query, users can further reward
documents matching more query terms through a coordination factor:
*coord-factor(q,d)
"

*How we configure this factor?
I am needing if documents matching more term queries then their score are
higher.

Please show me more details. Thanks 1

Re: How further reward documents matching more query terms?

Posted by Ian Lea <ia...@gmail.com>.
If you read the javadocs and source for DefaultSimilarity you'll know
as much about it as I do, and see what the default is.  To customize
it, write your own subclass as I said before.


--
Ian.


On Tue, Feb 2, 2010 at 7:56 PM, Phan The Dai <th...@gmail.com> wrote:
> Dear Lan Lea,
> Thanks much for your reply.
> Please tell me more details of coord.
> what is its default?
> how to customize it, why we have to define.
>
> Thank you much for understading my question.
>
> On Sat, Jan 30, 2010 at 2:46 AM, Ian Lea <ia...@gmail.com> wrote:
>
>> I presume that quote is from the javadocs for Similarity.
>>
>> You can write your own Similarity class that extends DefaultSimilarity
>> and provides an implementation of public float coord(int overlap, int
>> maxOverlap) that does what you want, maybe by scaling up the value
>> returned, if I've understood the description properly.
>>
>> Tell lucene to use your class by calling
>> Similarity.setDefault(Similarity similarity).
>>
>> Warning: in my limited experience of trying to tweak lucene's scoring
>> I almost always make things worse rather than better.  YMMV.  Good
>> luck.
>>
>>
>> --
>> Ian.
>>
>>
>> On Fri, Jan 29, 2010 at 4:27 PM, Phan The Dai <th...@gmail.com>
>> wrote:
>> > "When searching with a query as a multi term query, users can further
>> reward
>> > documents matching more query terms through a coordination factor:
>> > *coord-factor(q,d)
>> > "
>> >
>> > *How we configure this factor?
>> > I am needing if documents matching more term queries then their score are
>> > higher.
>> >
>> > Please show me more details. Thanks 1
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>

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


Re: How further reward documents matching more query terms?

Posted by Phan The Dai <th...@gmail.com>.
Dear Lan Lea,
Thanks much for your reply.
Please tell me more details of coord.
what is its default?
how to customize it, why we have to define.

Thank you much for understading my question.

On Sat, Jan 30, 2010 at 2:46 AM, Ian Lea <ia...@gmail.com> wrote:

> I presume that quote is from the javadocs for Similarity.
>
> You can write your own Similarity class that extends DefaultSimilarity
> and provides an implementation of public float coord(int overlap, int
> maxOverlap) that does what you want, maybe by scaling up the value
> returned, if I've understood the description properly.
>
> Tell lucene to use your class by calling
> Similarity.setDefault(Similarity similarity).
>
> Warning: in my limited experience of trying to tweak lucene's scoring
> I almost always make things worse rather than better.  YMMV.  Good
> luck.
>
>
> --
> Ian.
>
>
> On Fri, Jan 29, 2010 at 4:27 PM, Phan The Dai <th...@gmail.com>
> wrote:
> > "When searching with a query as a multi term query, users can further
> reward
> > documents matching more query terms through a coordination factor:
> > *coord-factor(q,d)
> > "
> >
> > *How we configure this factor?
> > I am needing if documents matching more term queries then their score are
> > higher.
> >
> > Please show me more details. Thanks 1
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: How further reward documents matching more query terms?

Posted by Ian Lea <ia...@gmail.com>.
I presume that quote is from the javadocs for Similarity.

You can write your own Similarity class that extends DefaultSimilarity
and provides an implementation of public float coord(int overlap, int
maxOverlap) that does what you want, maybe by scaling up the value
returned, if I've understood the description properly.

Tell lucene to use your class by calling
Similarity.setDefault(Similarity similarity).

Warning: in my limited experience of trying to tweak lucene's scoring
I almost always make things worse rather than better.  YMMV.  Good
luck.


--
Ian.


On Fri, Jan 29, 2010 at 4:27 PM, Phan The Dai <th...@gmail.com> wrote:
> "When searching with a query as a multi term query, users can further reward
> documents matching more query terms through a coordination factor:
> *coord-factor(q,d)
> "
>
> *How we configure this factor?
> I am needing if documents matching more term queries then their score are
> higher.
>
> Please show me more details. Thanks 1
>

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