You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Amitha Talasila <Am...@mindtree.com> on 2007/09/18 15:07:53 UTC

Customize the way relevancy is calculated

Hi,

    I have the following requirement.

 

   We have an option to sort the search results by relevance. Right now we
are getting the search results making an http call

 

  If the user chooses that option, the results should be sorted based on the
relevance. But the relevance should be calculated in a particular way, for
example for a         total of 100%, key word match will contribute 35%,
availability of image for that product will contribute 15% and so on... 

 

  The 65% of the relevance can be computed while indexing the document and
posted as a field. But the keyword match is a run time score .Is there any
way of getting the relevance score as a combination of this 65% and 35%?

Any help would be appreciated.

 

Regards

Amitha

 

 



DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited.
E-mail may contain viruses. Before opening attachments please check them for viruses and defects. While MindTree Consulting Limited (MindTree) has put in place checks to minimize the risks, MindTree will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside.
Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission.
MindTree reserves the right to monitor and review the content of all messages sent to or from MindTree e-mail address. Messages sent to or from this e-mail address may be stored on the MindTree e-mail system or else where.

Re: Customize the way relevancy is calculated

Posted by Yonik Seeley <yo...@apache.org>.
On 9/18/07, Amitha Talasila <Am...@mindtree.com> wrote:
>   The 65% of the relevance can be computed while indexing the document and
> posted as a field. But the keyword match is a run time score .Is there any
> way of getting the relevance score as a combination of this 65% and 35%?

A FunctionQuery can get you the value of a field to use in a relevancy
score.  Put that it in a boolean query with the relevanct query and
boost each portion to give the correct weight.

+text:foo^.65  _val_:scorefield^.35

-Yonik