From solr-user-return-139811-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Wed Mar 14 10:53:41 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 1DC8F180654 for ; Wed, 14 Mar 2018 10:53:40 +0100 (CET) Received: (qmail 94844 invoked by uid 500); 14 Mar 2018 09:53: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 94829 invoked by uid 99); 14 Mar 2018 09:53:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2018 09:53:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E3B1418015E for ; Wed, 14 Mar 2018 09:53:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.148 X-Spam-Level: ** X-Spam-Status: No, score=2.148 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 3gYGjBC4SdSU for ; Wed, 14 Mar 2018 09:53:36 +0000 (UTC) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A13135F640 for ; Wed, 14 Mar 2018 09:53:35 +0000 (UTC) Received: by mail-io0-f172.google.com with SMTP id k21so3646362ioc.2 for ; Wed, 14 Mar 2018 02:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:from:subject:date:importance:in-reply-to :references; bh=upzLQDoHpzw+OgrXbuS6vFyXWZ9fdmxiYzMleKjT1U0=; b=Mkf2je382GtSUnU37v6gVl5JCgA0C7NDfWsm5risgo+LEWyfPGWA+AcH1wJLhrJNKr lPzW/FPGqxJUlfRzzWMEBldHD6ebrva///5Y8pDi69Sjr/RZKFmOT35o7ybHr3MSpel3 pB7/BI0bBe+Be+9BJ6SgsnKJQeqNtc/JA5smGLStqH9rm/G9DiI5NbdcnOxp5lMEvbsh Kdimkt8Ydhep53LhM771PUksZFGT2ttlII3lTKR80h01/tkk0a3pB04FIk8yy9P+RaMF FtOqCP9NE7lWGmxvdSVtq1Bk3SIUR16rMn2iPjCSk8VbCoXTtiSUSrTy3wY9tAyTypqJ YEMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version:to:from:subject:date :importance:in-reply-to:references; bh=upzLQDoHpzw+OgrXbuS6vFyXWZ9fdmxiYzMleKjT1U0=; b=lsQ9Ex8gdi7P5VN8stS8o6YIP1dZwU8NcMmY8IrY6lEnl0Y5HCmngp4xHuJZgoUoEF VFNwfaYfiQ7IXRZJGit2MSvtKXoze+LbuEKoDNilErtXcXB0CQHGffjDZuulETjMAu9O wAQxk4FtNycEJWYZ1erumqCG79Z4GACRGbLw1+73ds+m+MwMQ54hYXn0hxkKwVr06Vs5 10/F5hyeBSJR9V4U//L9/lOCo6heI+NWAkki7/3YZox5OazmBpVct6etjefbli5/LLJ6 72deqh9oFc4YVJiWnVk9TOn6sdXfYsSkEDHIfhooLf1c2/A/mR+v92cDJnaNiUtmX75K yfEA== X-Gm-Message-State: AElRT7GkPKMihD6ciwuHIPZQVidmtQF+D63xCUToj3URh/greIdBorMJ YxEsXB5t+VdL75vxHG3EupPXdBVr X-Google-Smtp-Source: AG47ELtu2yFSxJYivFYsX2wfDFMkL6tUBYCaemuO4E6+EcWbtWWkSpvkYTWaUEIA6DE328uJGJTCTg== X-Received: by 10.107.149.70 with SMTP id x67mr4043235iod.156.1521021213955; Wed, 14 Mar 2018 02:53:33 -0700 (PDT) Received: from ?IPv6:::ffff:192.168.1.186? ([218.255.228.166]) by smtp.gmail.com with ESMTPSA id 202sm932758itu.23.2018.03.14.02.53.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 02:53:33 -0700 (PDT) Message-ID: <5aa8f11d.d302240a.80f66.5124@mx.google.com> MIME-Version: 1.0 To: "solr-user@lucene.apache.org" From: Albert Lee Subject: RE: solr query Date: Wed, 14 Mar 2018 17:53:31 +0800 Importance: normal X-Priority: 3 In-Reply-To: References: <5aa89523.c11c620a.4c5c3.72d9@mx.google.com> <98FE55AC-6615-4579-A038-6EB548A6BA35@sematext.com> <5aa8ebf6.0a59240a.79a6f.480a@mx.google.com> Content-Type: multipart/alternative; boundary="_9BFE45A7-819C-48AA-B430-140F53C567D4_" --_9BFE45A7-819C-48AA-B430-140F53C567D4_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" I don=E2=80=99t want to add separate fields since I have many dates to inde= x. How to index it as timestamp and do function query, any example or docum= entation? Regards, Albert From: Emir Arnautovi=C4=87 Sent: Wednesday, March 14, 2018 5:38 PM To: solr-user@lucene.apache.org Subject: Re: solr query Hi Albert, The simplest solution is to index month/year as separate fields. Alternativ= e is to index it as timestamp and do function query to do some math and fil= ter out records. Emir -- Monitoring - Log Management - Alerting - Anomaly Detection Solr & Elasticsearch Consulting Support Training - http://sematext.com/ > On 14 Mar 2018, at 10:31, Albert Lee wrote: >=20 > NOW/MONTH and NOW/YEAR to get the start of month/year, but how can I get = current month of regardless year. Like the use case, people who=E2=80=99s = birthdate is this month? >=20 > Regard, > Albert >=20 >=20 > From: Emir Arnautovi=C4=87 > Sent: Wednesday, March 14, 2018 5:26 PM > To: solr-user@lucene.apache.org > Subject: Re: solr query >=20 > Hi Albert, > It does - you can use NOW/MONTH and NOW/YEAR to get the start of month/ye= ar. Here is reference to date math: https://lucene.apache.org/solr/guide/6_= 6/working-with-dates.html#WorkingwithDates-DateMathSyntax >=20 > HTH, > Emir > -- > Monitoring - Log Management - Alerting - Anomaly Detection > Solr & Elasticsearch Consulting Support Training - http://sematext.com/ >=20 >=20 >=20 >> On 14 Mar 2018, at 04:21, Albert Lee wrote: >>=20 >> Dear Solr, >> I want to whether solr support query by this year or this month? >> If can, how to do that.=20 >> Thanks. >>=20 >> Regards, >> Albert=20 >>=20 >=20 >=20 --_9BFE45A7-819C-48AA-B430-140F53C567D4_--