: 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"])

that syntax definitely does not work ... i don't know if there is a typo 
in your mail, or if you are just getting strange results that happen to 
look like they might be correct, but that syntax is not doing what you 
asked for.

the most straight forward way to achieve what you described is by using 
the "frange" parser to filter on the output of a funcion where the inputs 
are your two filed names...

  fq={!frange l=0}sub(merchant_end_of_day_in_utc_epoch,start_time_utc_epoch)

  https://wiki.apache.org/solr/FunctionQuery#Using_FunctionQuery

...that filter query will only match documents where the value of the 
field merchant_end_of_day_in_utc_epoch minus the value of the field 
start_time_utc_epoch is greater then zero.

if you want to speed that up, just do the calculation when indexing and 
create a special boolean field to filter on...

  fq=merchant_end_of_day_after_start_time:true

...you can then combine that with another filter on the date range...

  fq=start_time:[1970-01-01T00:00:00Z TO *]

...or you can combine everything into one function using the "ms" function 
to convert dates to numeric milliseconds

: > 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

-Hoss

Reply via email to