Return-Path: Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: (qmail 32371 invoked from network); 22 Oct 2009 14:26:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Oct 2009 14:26:48 -0000 Received: (qmail 57911 invoked by uid 500); 22 Oct 2009 14:26:48 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 57846 invoked by uid 500); 22 Oct 2009 14:26:48 -0000 Mailing-List: contact solr-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-commits@lucene.apache.org Received: (qmail 57836 invoked by uid 99); 22 Oct 2009 14:26:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 14:26:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 14:26:45 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id BF89516E31 for ; Thu, 22 Oct 2009 14:26:24 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Thu, 22 Oct 2009 14:26:24 -0000 Message-ID: <20091022142624.28277.77773@eos.apache.org> Subject: =?utf-8?q?=5BSolr_Wiki=5D_Update_of_=22SolrRelevancyFAQ=22_by_YonikSeeley?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for chan= ge notification. The "SolrRelevancyFAQ" page has been changed by YonikSeeley. The comment on this change is: add reference to QuertyElevation , move func= tion next to index-boosting since it's related. http://wiki.apache.org/solr/SolrRelevancyFAQ?action=3Ddiff&rev1=3D14&rev2= =3D15 -------------------------------------------------- = = =3D=3D How can I increase the score for specific documents =3D=3D + =3D=3D=3D index-time boosts =3D=3D=3D To increase the scores for certain documents that match a query, regardle= ss of what that query may be, one can use index-time boosts. = Index-time boosts can be specified per-field also, so only queries matchi= ng on that specific field will get the extra boost. An Index-time boost on= a value of a multiValued field applies to all values for that field. = - Index-time boosts are assigned with the optional attribute "boost" in the= section of the XML updating messages. See UpdateXmlMessages for more= informations. + Index-time boosts are assigned with the optional attribute "boost" in the= section of the XML updating messages. See UpdateXmlMessages for more= information. = + =3D=3D=3D Query Elevation Component =3D=3D=3D + To raise certain documents to the top of the result list based on a certa= in queries, one can use the QueryElevationComponent. + = + =3D=3D How can I change the score of a document based on the *value* of a= field (say, "popularity") =3D=3D + Use a FunctionQuery as part of your query. + = + Solr can parse function queries in the following [[http://lucene.apache.o= rg/solr/api/org/apache/solr/search/QueryParsing.html#parseFunction(java.lan= g.String,%20org.apache.solr.schema.IndexSchema)|syntax]]. + = + Some examples... + {{{ + # simple boosts by popularity + q=3D%2Bsupervillians+_val_:"popularity" + defType=3Ddismax&qf=3Dtext&q=3Dsupervillians&bf=3Dpopularity + = + # boosts based on complex functions of the popularity field + q=3D%2Bsupervillians+_val_:"scale(popularity,0,100)" + defType=3Ddismax&qf=3Dtext&q=3Dsupervillians&bf=3Dsqrt(popularity) + }}} = =3D=3D How are documents scored =3D=3D Basic scoring factors: @@ -161, +180 @@ = Now you should be able to examine the scoring explain info of the top mat= ching documents, compare it to the explain info for documents matching id:j= uggernaut, and determine why the rankings are not as you expect. = - =3D=3D How can I change the score of a document based on the *value* of a= field (say, "popularity") =3D=3D - Use a FunctionQuery as a component of your query. - = - Solr can parse function queries in the following [[http://lucene.apache.o= rg/solr/api/org/apache/solr/search/QueryParsing.html#parseFunction(java.lan= g.String,%20org.apache.solr.schema.IndexSchema)|syntax]]. - = - Some examples... - {{{ - # simple boosts by popularity - q=3D%2Bsupervillians+_val_:"popularity" - defType=3Ddismax&qf=3Dtext&q=3Dsupervillians&bf=3Dpopularity - = - # boosts based on complex functions of the popularity field - q=3D%2Bsupervillians+_val_:"scale(popularity,0,100)" - defType=3Ddismax&qf=3Dtext&q=3Dsupervillians&bf=3Dsqrt(popularity) - }}} - = = =3D=3D How can I boost the score of newer documents =3D=3D * Do an explicit sort by date (relevancy scores are ignored)