From solr-user-return-120153-apmail-lucene-solr-user-archive=lucene.apache.org@lucene.apache.org Mon Jan 25 01:35:43 2016 Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4C6BB1898F for ; Mon, 25 Jan 2016 01:35:43 +0000 (UTC) Received: (qmail 33212 invoked by uid 500); 25 Jan 2016 01:35:39 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 33144 invoked by uid 500); 25 Jan 2016 01:35:39 -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 33130 invoked by uid 99); 25 Jan 2016 01:35:39 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jan 2016 01:35:39 +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 17488C1007 for ; Mon, 25 Jan 2016 01:35:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id MYDqlDR-dvnb for ; Mon, 25 Jan 2016 01:35:38 +0000 (UTC) Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id E7C2343A84 for ; Mon, 25 Jan 2016 01:35:37 +0000 (UTC) Received: by mail-ob0-f173.google.com with SMTP id vt7so104654817obb.1 for ; Sun, 24 Jan 2016 17:35:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=8ZqdDw7s1BbjaLvHs+4ks5Qz9XZc2VW2l3+rSTEflMU=; b=RPVJvVG6KC6cj5zwT0T3olRXD2cc15Z8cCwZT8IRoPQ5J2r7Avw65/5zfLCGX/rI16 ih9+qRKtTnTSwiGaIT+FUfA61srW0ywDsjYSAvUVHtUhEYOncNSY3ILNTYFHG9rFKCoF 3wjbh+P381IzeUKBmo8bORR1fHzESyUCPnDm/TNDQrOa68yTxsXuJR2k0nwnfn17bLaw DqqEZIawQNU6KYbxBp49/w6PWdTX0hexds6hHlnH1izUHc+25rQ46UR++0ZSHPAGChI3 E4MColROUmzB3lItNWMe0AE4F9SZLVBmt3xL2YQ+TW0RkB/OmIG52Dx5s02wqDQJYfR4 m9Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=8ZqdDw7s1BbjaLvHs+4ks5Qz9XZc2VW2l3+rSTEflMU=; b=REoVA2vYcv/rD3N1yhZNnL4bbKNge8ZKMZdO+XDJzO7kJkgcHpzaYZhPAgUtywzrZH pU91Mi7Zym4t7vPxw8usELiL08wJ8Mi1HMHUd/CBKdxugw1TROeQn872nXXUY3+ll12z Mb7W0FKoNt+lGV+puLAex0L+8OHFIRqf0XRpRBEnMEx2PXHvfG2UQjwyTSjnZSNXDGp2 RyXmkWH6/SUf933+k8sLx4g25H7h/A0FlBCxZb9Rivr1U6GHd6wc8Px8cCaNVnda56ot qqnF1+FZohBY0HGOGKdT/PWJ+1xNgkX2CpEqpiopmKgb+t/hmVVfPgkdp4NIPUtv8ap/ l87Q== X-Gm-Message-State: AG10YOQWbGvtdEpKmrZRV2+CrxkkmHMF9Ucs6caJ9e0PkZRsua2CWGCZQpZvEIdi/B2QbWWWVl8QcCLTYHGNNQ== MIME-Version: 1.0 X-Received: by 10.182.60.170 with SMTP id i10mr11035305obr.62.1453685731442; Sun, 24 Jan 2016 17:35:31 -0800 (PST) Received: by 10.202.53.194 with HTTP; Sun, 24 Jan 2016 17:35:31 -0800 (PST) In-Reply-To: <39A517CB-BF8C-429E-A51A-A646BA6E1152@gmail.com> References: <39A517CB-BF8C-429E-A51A-A646BA6E1152@gmail.com> Date: Sun, 24 Jan 2016 17:35:31 -0800 Message-ID: Subject: Re: facet by update date From: Jay Potharaju To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a11c1bd42a34683052a1e9579 --001a11c1bd42a34683052a1e9579 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Which is a better option facet.interval or facet.query in terms of performance? Thanks On Sun, Jan 24, 2016 at 5:04 PM, Erik Hatcher wrote: > I suggest facet.query is the way to go for a handful of buckets/ranges. > > I'm mobile so apologies for not providing some examples but something lik= e > a few of these kinds of things: > > facet.query=3D{!lucene key=3Dunder_24_hours}update_date:[NOW-24HOURS T= O NOW] > > Things get interesting if you want < 3 days to not include under 24 hour > ones too, but just some considered Lucene query clauses will do the trick= . > > Erik > > > On Jan 24, 2016, at 18:38, Jay Potharaju wrote: > > > > Thanks Pavel, > > I was trying it using the range faceting instead of facet.interval. Can > > someone comment on performance of using facet.interval with sharded > index > > and high number of documents. > > Thanks > > J > > > > On Sun, Jan 24, 2016 at 1:09 PM, Pavel Pol=C3=ADvka > > wrote: > > > >> Hi, > >> We are doing this via interval facet: > >> > >> Something like this: > >> facet=3Don& > >> facet.interval=3Dupdate_date& > >> facet.interval.set=3D[NOW-1DAY,NOW]& > >> facet.interval.set=3D[NOW-3DAY,NOW-1DAY)& > >> facet.interval.set=3D[NOW-7DAY,NOW-3DAY)& > >> facet.interval.set=3D[NOW-1MONTH,NOW-7DAY)& > >> facet.interval.set=3D[NOW-1YEAR,NOW-1MONTH) > >> > >> I do not know if this is a correct way of doing this, but I did not fi= nd > >> anything better. > >> Here is link for interval faceting in wiki: > >> > >> > https://cwiki.apache.org/confluence/display/solr/Faceting#Faceting-Interv= alFaceting > >> > >> Hope this helps. > >> > >> Pavel > >> > >> > >> ne 24. 1. 2016 v 17:20 odes=C3=ADlatel Jay Potharaju > >> napsal: > >> > >>> Hi, > >>> I am trying to calculate facet for update_date of the document. And > would > >>> like to get the following values > >>> - < 24 Hrs > >>> - < 3 days > >>> - < 1 week > >>> - < 1 month > >>> - < 6 months > >>> - <1 year > >>> > >>> >>> required=3D"true" multiValued=3D"false" docValues=3D"true"/> > >>> > >>> The above facet values should change every time someone queries, > >> therefore > >>> a document that was updated today will show will be in the facet "24 > >> hrs" > >>> and when the same query runs 2 weeks from today, the document will be > >>> marked as "< 1 month". > >>> > >>> How can I set my facets to get the above values? > >>> > >>> -- > >>> Thanks > >>> Jay > > > > > > > > -- > > Thanks > > Jay Potharaju > --=20 Thanks Jay Potharaju --001a11c1bd42a34683052a1e9579--