Return-Path: Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: (qmail 96189 invoked from network); 10 Mar 2011 21:21:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Mar 2011 21:21:29 -0000 Received: (qmail 90949 invoked by uid 500); 10 Mar 2011 21:20:44 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 90074 invoked by uid 500); 10 Mar 2011 21:20:44 -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 89737 invoked by uid 99); 10 Mar 2011 21:16:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Mar 2011 21:16:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Mar 2011 21:16:49 +0000 Received: from eosnew.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 27B7212A; Thu, 10 Mar 2011 21:16:28 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Thu, 10 Mar 2011 21:16:27 -0000 Message-ID: <20110310211627.31255.86841@eosnew.apache.org> Subject: =?utf-8?q?=5BSolr_Wiki=5D_Update_of_=22FunctionQuery=22_by_YonikSeeley?= Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for chan= ge notification. The "FunctionQuery" page has been changed by YonikSeeley. The comment on this change is: document relevance function queries. http://wiki.apache.org/solr/FunctionQuery?action=3Ddiff&rev1=3D74&rev2=3D75 -------------------------------------------------- = See the java.util.Math javadocs for more details. = + =3D=3D Relevance Functions =3D=3D + [[Solr4.0]] + = + Relevancy functions that take terms can use a bare term if it's a simple = word + . Example: '''docfreq(text,solr)''' + Can optionally quote the term if it's more complex + . Example: '''docfreq(text,'solr')''' + And can even do parameter substitution for the term value + . Example Partial Request: '''&defType=3Dfunc&q=3Ddocfreq(text,$myterm)&= term=3Dsolr''' + = + =3D=3D=3D docfreq =3D=3D=3D + '''docfreq(field,term)''' returns the number of documents that contain th= e term in the field. This is a constant (the same value for all documents = in the index). + = + . Example Syntax: '''docfreq(text,'solr')''' + = + =3D=3D=3D termfreq =3D=3D=3D + '''termfreq(field,term)''' returns the number of times the term appears i= n the field for that document. + = + . Example Syntax: '''docfreq(text,'memory')''' + = + =3D=3D=3D idf =3D=3D=3D + '''idf(field,term)''' returns the inverse document frequency for the give= n term, using the [[http://lucene.apache.org/java/3_0_0/api/core/org/apache= /lucene/search/Similarity.html|Similarity] for the field. + = + . Example Syntax: '''idf(text,'solr')''' + = + =3D=3D=3D tf =3D=3D=3D + '''tf(field,term)''' returns the term frequency factor for the given term= , using the [[http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucen= e/search/Similarity.html|Similarity] for the field. + = + . Example Syntax: '''tf(text,'solr')''' + = + =3D=3D=3D norm =3D=3D=3D + '''norm(field)''' returns the "norm" stored in the index, the product of = the index time boost and then length normalization factor, according to the= [[http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/search/S= imilarity.html|Similarity] for the field. + = + . Example Syntax: '''norm(text)''' + = + =3D=3D=3D maxdoc =3D=3D=3D + '''maxdoc()''' returns the number of documents in the index, including th= ose that are marked as deleted but have not yet been purged. This is a con= stant (the same value for all documents in the index). + = + =3D=3D=3D numdocs =3D=3D=3D + '''numdocs()''' returns the number of documents in the index, not includi= ng those that are marked as deleted but have not yet been purged. This is = a constant (the same value for all documents in the index). + = + = =3D=3D dist =3D=3D [[Solr3.1]] =20