datetime - Solr: Best way to query for documents added this current week? -
alright guys. want query in such way hit same filter cache, dont want calcuate start of week in code , structure query based on that. there way solr returning based on week ?
i couldnt find here : http://docs.lucidworks.com/display/lweug/solr+date+format using [now/day-7days now/day+1day] wont since not know start , end of week.
does involve calculation on client side , formulating query based on that, so, not looking :)
in java (if week starts on monday):
client:
(new date().gettime()-345600000)/604800000 = 2257
query:
select?q=*:*&fq={!frange%20l=2257%20u=2258}div(sub(field(last_update),345600000),604800000)&wt=json&indent=true
Comments
Post a Comment