Return-Path: Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: (qmail 57260 invoked from network); 16 Apr 2010 18:40:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Apr 2010 18:40:13 -0000 Received: (qmail 39232 invoked by uid 500); 16 Apr 2010 18:40:13 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 39203 invoked by uid 500); 16 Apr 2010 18:40:12 -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 39196 invoked by uid 99); 16 Apr 2010 18:40:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Apr 2010 18:40:12 +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; Fri, 16 Apr 2010 18:40:10 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 4915C16E29; Fri, 16 Apr 2010 18:39:49 +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: Fri, 16 Apr 2010 18:39:49 -0000 Message-ID: <20100416183949.29873.96469@eos.apache.org> Subject: =?utf-8?q?=5BSolr_Wiki=5D_Update_of_=22FunctionQuery=22_by_ChrisHarris?= 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 "FunctionQuery" page has been changed by ChrisHarris. The comment on this change is: Clarify that "classic" date fields *do* have= "ord" behavior for fieldvalue.. http://wiki.apache.org/solr/FunctionQuery?action=3Ddiff&rev1=3D57&rev2=3D58 -------------------------------------------------- . Example Syntax: '''myFloatField''' . SolrQuerySyntax Example: '''_val_:myFloatField''' = + For non-numeric fields, fields are still evaluated to a numeric value. Ho= w this works depends on the field type: + = - For date fields, the fieldvalue behavior is as follows: If the document h= as a value in that field, then the numeric field value is the number of mil= liseconds(?) between that date and the epoch. If the document has no value = in that field, then the numeric field value is 0. (That is, the default=3D= =3D0 convention still holds for dates.) + * For new date fields (i.e. those based on the TrieDateField class), the= fieldvalue behavior is as follows: If the document has a value in that fie= ld, then the numeric field value is the number of milliseconds(?) between t= hat date and the epoch. If the document has no value in that field, then th= e numeric field value is 0. (That is, the default=3D=3D0 convention still h= olds for dates.) - = + * For "classic" date fields (i.e. those based on DateField or LegacyDate= Field), the fieldvalue value is not a function of the date field itself; ra= ther, it gives the "ord" ordinal ranking of that field's value. (See "ord".= ) The default=3D=3D0 convention still holds. - For boolean fields (e.g. solr.BoolField), the fieldvalue behavior may not= be what you expect. In particular, don't assume that true maps to 1.0 and = false to 0.0. At least on a pre-1.4 build, Chris Harris noted that true was= mapping to 2.0. The justification (from debugQuery=3Don) is as follows: " = 2.0 =3D ord(inStock)=3D2". + * For boolean fields (e.g. solr.BoolField), the fieldvalue behavior may = not be what you expect. In particular, don't assume that true maps to 1.0 a= nd false to 0.0. At least on a pre-1.4 build, Chris Harris noted that true = was mapping to 2.0. The justification (from debugQuery=3Don) is as follows:= " 2.0 =3D ord(inStock)=3D2". = =3D=3D ord =3D=3D ord(myfield) returns the ordinal of the indexed field value within the in= dexed list of terms for that field in lucene index order (lexicographically= ordered by unicode value), starting at 1. In other words, for a given fiel= d, all values are ordered lexicographically; this function then returns the= offset of a particular value in that ordering. The field must have a maxim= um of one value per document (not multiValued). 0 is returned for document= s without a value in the field.