lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Indika Tantrigoda <indik...@gmail.com>
Subject Re: Solr Range Queries with Field value
Date Wed, 01 May 2013 05:15:23 GMT
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 <arunrangarajan@gmail.com> 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 <erickerickson@gmail.com
> >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 <indika85@gmail.com>
> > 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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message