On Wed, Aug 17, 2011 at 12:01 PM, slaava <slaav...@gmail.com> wrote: [...] > My first idea was to index date in yyyymmdd format (20110817) and use > modulo: > 1 year: indexed_date % 10000 = 0817 > 5 year: indexed_date % 50000 = 10817 > 10 year: indexed_date % 100000 = 10817 > > but I didn't found something like modulo function in solr... [...]
Could you not index mmdd, and yyyy separately? First do a match on mmdd to get all persons (this is also the set of all 1-year matches), and then use yyyy to get 5-year, and 10 year matches. Regards, Gora P.S. If you want to do a modulus, please see function queries: http://wiki.apache.org/solr/FunctionQuery Not completely sure, but in Solr 3.1, mod() should be available from java.util.Math