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 lucas van overberghe <lu...@gmail.com> on 2013/03/12 08:36:17 UTC

Lucene scoring

Hi,

We are currently using Hibernate Search but had some questions
regarding scoring. We are implementing a quicksearchengine in our
webapp but want to customize the scoring a bit.

Let's say, you have a User named Peter, and a search is done on Peter.
The first result should therefore not be a document where his name
pops up a few times but instead be the contact details of Peter where
his name might popup only once.

How would we go and implement this ? Is it neccesary to change the
Lucene scoring algorithm or is there a better/easier way?

Thanks and kind regards,

Lucas Van Overberghe

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


Re: Lucene scoring

Posted by Ian Lea <ia...@gmail.com>.
Sounds like a job for boosting.  Document.setBoost() and/or
Field.setBoost().  The former has gone away in lucene 4.x.  See the
migration guide.

Or execute 2 searches, restricting the first to the contact docs or
whichever you want to be top of the list.


--
Ian.


On Tue, Mar 12, 2013 at 7:36 AM, lucas van overberghe
<lu...@gmail.com> wrote:
> Hi,
>
> We are currently using Hibernate Search but had some questions
> regarding scoring. We are implementing a quicksearchengine in our
> webapp but want to customize the scoring a bit.
>
> Let's say, you have a User named Peter, and a search is done on Peter.
> The first result should therefore not be a document where his name
> pops up a few times but instead be the contact details of Peter where
> his name might popup only once.
>
> How would we go and implement this ? Is it neccesary to change the
> Lucene scoring algorithm or is there a better/easier way?
>
> Thanks and kind regards,
>
> Lucas Van Overberghe
>
> ---------------------------------------------------------------------
> 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