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 3683E109BE for ; Wed, 1 May 2013 05:16:22 +0000 (UTC) Received: (qmail 21940 invoked by uid 500); 1 May 2013 05:16:18 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 21340 invoked by uid 500); 1 May 2013 05:16:12 -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 21307 invoked by uid 99); 1 May 2013 05:16:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 May 2013 05:16:11 +0000 X-ASF-Spam-Status: No, hits=3.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of indika85@gmail.com designates 209.85.192.179 as permitted sender) Received: from [209.85.192.179] (HELO mail-pd0-f179.google.com) (209.85.192.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 May 2013 05:16:04 +0000 Received: by mail-pd0-f179.google.com with SMTP id y10so674582pdj.38 for ; Tue, 30 Apr 2013 22:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=AP65fRBgM1cdzPKr5R+MJhB/D4l29OjE3TD9/0Sks9A=; b=QzkJzSq1SCOglCfs85e4FdenUsa3iEf4tS00AKxQfSBSzFNoHfTzz2kk9Fq4QfI3bD dcTocf9d6aS3Ji5Jau3G9Z+LwHJjAkq9R4mqnxNCwJbFq1RIBRqMlebci0w7TW4kmWqG 9jeRJ1XoIAzC5rB96Pj5q7bPP/cHfeTqnG5vj5OsJx58bCi3qBV9tWzhVTDjdVbOS+08 VjzEwYG0li+orrsNc3phjCtcLZyU2p7V7HZjlKK9wau0e0tXRUsQ60/ZTwk0bm6rk6TC 19OtPPSy50wXZ736L6gWeyZI+aIlp/qfF0OnvXcufdb6CL4aK8XvWUS3Re56GAbXNtFW 3YPw== X-Received: by 10.68.129.162 with SMTP id nx2mr2264228pbb.178.1367385343338; Tue, 30 Apr 2013 22:15:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.163.99 with HTTP; Tue, 30 Apr 2013 22:15:23 -0700 (PDT) In-Reply-To: References: From: Indika Tantrigoda Date: Wed, 1 May 2013 10:45:23 +0530 Message-ID: Subject: Re: Solr Range Queries with Field value To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=047d7b10ce2fa9342104dba13561 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b10ce2fa9342104dba13561 Content-Type: text/plain; charset=ISO-8859-1 Yes, the SQL statement is what I am trying to achieve. As for the merchant_end_of_day_in_utc_epoch, we map the time to start of epoch and convert that to UTC, so that all the merchants are in the same timezone which would make it easier to query for open ones. For the use case when we need to determine if a merchant is currently open now or in the future (within the same day). Therefore when converting the start/end times to epoch and UTC a session (i.e. start time to end time) might get spilled over past 12 midnight. After some research the following syntax worked start_time_utc_epoch:[1970-01-01T00:00:00Z TO _val_:"merchant_end_of_day_in_utc_epoch"]) Thanks, Indika On 1 May 2013 00:52, Arun Rangarajan wrote: > Erick, > > I believe Indika wants to do this SQL WHERE clause in Solr: > WHERE start_time_utc_epoch >= '1970-01-01T00:00:00Z' AND > start_time_utc_epoch > <= merchant_end_of_day_in_utc_epoch > > > On Tue, Apr 30, 2013 at 11:49 AM, Erick Erickson >wrote: > > > Could you define your use-case in some more detail? On the > > surface, this query doesn't really make a lot of sense. How > > would merchant_end_of_day_in_utc_epoch be determined? > > Presumably there are zillions of values across your index for > > this value, depending on the document. Which one should be > > used? > > > > Best > > Erick > > > > On Mon, Apr 29, 2013 at 8:34 PM, Indika Tantrigoda > > wrote: > > > Hi All, > > > > > > I'd like to know if its possible to use a field value in a Solr range > > query > > > ? Something similar to start_time_utc_epoch:[1970-01-01T00:00:00Z TO > > > merchant_end_of_day_in_utc_epoch]) > > > > > > merchant_end_of_day_in_utc_epoch is an indexed field. > > > > > > I am using Solr 4. > > > > > > Thanks, > > > Indika > > > --047d7b10ce2fa9342104dba13561--