From solr-user-return-151394-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri Jan 10 10:03:35 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2851D180657 for ; Fri, 10 Jan 2020 11:03:35 +0100 (CET) Received: (qmail 26083 invoked by uid 500); 10 Jan 2020 10:03:30 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 26071 invoked by uid 99); 10 Jan 2020 10:03:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jan 2020 10:03:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id AC99EC0B27 for ; Fri, 10 Jan 2020 10:03:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.011 X-Spam-Level: X-Spam-Status: No, score=0.011 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=indiamart.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id U9jxXyma08CS for ; Fri, 10 Jan 2020 10:03:27 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::333; helo=mail-ot1-x333.google.com; envelope-from=paras.lehana@indiamart.com; receiver= Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 141C67DD7F for ; Fri, 10 Jan 2020 10:03:27 +0000 (UTC) Received: by mail-ot1-x333.google.com with SMTP id 66so1385265otd.9 for ; Fri, 10 Jan 2020 02:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=indiamart.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=1Z5daqoTaHdG/YisvN6Kh8N7OVbt4XEjt5M5ezIUg4o=; b=S7qtr1iDB1Xbat9t+8Xw7OpwmzCWQUwGCu4YNQFQpdD2XdMSpbNGd41sdAii1Y5xno e+EdD7C044JFzLeLugVzgE5522Iz1/QxizNJAGuTnzZaMAbv9kD9liZdKKJ6PkIUhkYq dPAinjlak/KOq+c1aT1cEPve25McER7Bnbm90= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=1Z5daqoTaHdG/YisvN6Kh8N7OVbt4XEjt5M5ezIUg4o=; b=dXh2bHEkgJlvvr6YHBEbsBHmJFhcrYyy0l7sdQ0z7dGd8BUnVzL4T8XvxuLSpkDwMJ +kTT56ADyWuiVlHsjUhmpUAhdbVcsjCd1PukhH80vN9Aen0NBYNfJDov14VYBTM4wxnz ZPbnmqGD/cl7WCYUoGe4czMTwksgVNOXUMzjdQ+qtsobuOvu9/tUf+CpfGDaHplI/hwK /qktHrG5S1q5G8yhSP+8OdYxHtXrFMGIrBHa8i5npCQYE4nyBXbH9ryIxMYBq4cs678Z zOitL9ZLQ7ORducl4AtKe0QZFdkUYWyhfWBiWXrkj+hsyuVH4Bul9h/IcmXsZhkVBV1m x/Kg== X-Gm-Message-State: APjAAAXSD4OZkp79rQxZVoUN/hQPimpbOYBnCdw3m4vOvJ5XrPymHSjQ SyHkwtyUJI//YqANSpRtFF6kz4Cd1ow1+eQ7ZtaslghI/DNKioh7eFr451Gd7ICc1lncVD3rCFH hckoMjHDyNm/kIPZoemVTKmS2xEtNDLuodqcR X-Google-Smtp-Source: APXvYqxO8LwZKtyphUDsALEvZC8coMqlk4TbxsxPqJ3CgRPgMAqEJNaQOXSOYcbJ6uGsQte170vyuqNaszlXFB2Q/xk= X-Received: by 2002:a9d:6b17:: with SMTP id g23mr1809934otp.265.1578650605567; Fri, 10 Jan 2020 02:03:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Paras Lehana Date: Fri, 10 Jan 2020 15:32:49 +0530 Message-ID: Subject: Re: Facet Range by Distance generating count of field - need sum of the field To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary="00000000000091cc50059bc63c9c" --00000000000091cc50059bc63c9c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Robert, How does this work? {!frange l=3D0 u=3D5} sum(geodist()) On Fri, 3 Jan 2020 at 21:10, Robert Scavilla wrote: > Thank yo in advance for your help. > > I need to get the sum of a pivot range field. The following query uses th= e > stats function to sum the *sumField* values. I'm trying to sum the same > field in a frange subquery and I don't know how. > > > /select?defType=3Dedismax&q=3D*:*&fq=3D{!geofilt}&fl=3DtotalResultsUsers,= _dist_:geodist(),score&sort=3Dgeodist() > > desc&facet=3Dtrue&rows=3D0&facet.limit=3D-1&facet.mincount=3D1&facet.sort= =3Dvalue&stats=3Dtrue&distanceUnits=3Dmiles&wt=3Djson&fq=3DdId:193&sfield= =3DCoordinates&pt=3D40.243919,-74.753489&d=3D5&stats.field=3D{!tag=3Dt1}sum= Field&facet.pivot=3D{!stats=3Dt1}startDate&fq=3DstartDate:[2019-12-01 > TO *]&facet.query=3D{!frange l=3D0 u=3D5}geodist()&facet.query=3D{!frange= l=3D5.001 > u=3D10}geodist() > > This query produces the following results: > > "facet_counts":{ > "facet_queries":{ > "{!frange l=3D0 u=3D5}geodist()":27, > "{!frange l=3D5.001 u=3D10}geodist()":0}, > "facet_pivot":{ > "startDate":[{ > "field":"startDate", > "value":"2019-12-01", > "count":27, > "stats":{ > "stats_fields":{ > "users":{ > "min":1.0, > "max":158.0, > **"count":27, > "missing":0, > "sum":488.0, > "sumOfSquares":40848.0, > "mean":18.074074074074073, > "stddev":35.09758475793535}}}}]}}, > > > .... > > What I'm going for is line: "*{!frange l=3D0 u=3D5}geodist()":27* should = be > 488.0 which is the sum of the field as opposed to 27 which is the count o= f > the field. > > Thank you! > --=20 --=20 Regards, *Paras Lehana* [65871] Development Engineer, Auto-Suggest, IndiaMART Intermesh Ltd. 8th Floor, Tower A, Advant-Navis Business Park, Sector 142, Noida, UP, IN - 201303 Mob.: +91-9560911996 Work: 01203916600 | Extn: *8173* --=20 * * --00000000000091cc50059bc63c9c--