Solr: calculating query lead times in the date and current date fields

Given the following schema fields:

<field indexed="true" stored="true" name="Status" type="int" /> <field indexed="true" stored="true" name="StatusDate1" type="tdate" /> <field indexed="true" stored="true" name="StatusDate2" type="tdate" /> 

Is it possible for solr to handle the status calculation, given the current daily date and the StatusDate1 and StatusDate2 fields?

For example: a certain object contains (ignore sintax) StatusDate1: 1/9/2016, StatusDate2: 5/9/2016, knowing that today, on 9/9/2016, the expected result will be Status = 2.

This status is calculated based on the current date and StatusDate fields for each object. I would like to facet the Status field.

Are functional queries , how to go? Or do I need to handle this during the index? (Indexing a task every day seems like a dummy). What is the best way to solve this problem?

Note: My version is solr 4.6.0

+5
source share
1 answer

Regardless of the cut, have you tried the stats component ? stats = true & stats.field = Status ... filtering by date fields

+1
source

All Articles