You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mark N <ni...@gmail.com> on 2010/02/10 14:12:43 UTC

Getting max/min dates from solr index

How can we get the max and min date from the Solr index ? I would need these
dates to draw a graph ( for example timeline graph )


Also can we use date faceting to show how many documents are indexed every
month  .
Consider I need to draw a timeline graph for current year to show how many
records are indexed for every month  .So i will have months in X axis and no
of document in Y axis.

What should be the better approach to design a schema to achieve this
functionality ?


Any suggestions would be appreciated

thanks


-- 
Nipen Mark

Re: Getting max/min dates from solr index

Posted by Chris Hostetter <ho...@fucit.org>.
: Is it possible to do date faceting on multiple solr shards?

Distributed search doesn't currently support date faceting...

http://wiki.apache.org/solr/DistributedSearch#Distributed_Searching_Limitations
https://issues.apache.org/jira/browse/SOLR-1709


-Hoss


Re: Getting max/min dates from solr index

Posted by Mark N <ni...@gmail.com>.
thanks .
Is it possible to do date faceting on multiple solr shards?

I am using index created in two different shards to do date faceting on
field "DATE"

*
http://localhost:8983/solr/1_13_1_3/select?&shards=localhost:8983/solr/index1/,localhost_two:8983/solr/index/&start=0&rows=20&q=*&facet=true&facet.date=DATE&facet.date.start=2004-01-01T00:00:00Z&facet.date.end=2011-01-01T00:00:00Z&facet.date.gap=%2B1YEAR
*




On Fri, Feb 12, 2010 at 3:39 AM, Otis Gospodnetic <
otis_gospodnetic@yahoo.com> wrote:

> Mark,
>
> Yes, facets will give you that information. Min/max.... StatsComponent?
>  See http://www.search-lucene.com/?q=StatsComponent
>
>  Otis
> ----
> Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
> Hadoop ecosystem search :: http://search-hadoop.com/
>
>
>
> ----- Original Message ----
> > From: Mark N <ni...@gmail.com>
> > To: solr-user@lucene.apache.org
> > Sent: Wed, February 10, 2010 8:12:43 AM
> > Subject: Getting max/min dates from solr index
> >
> > How can we get the max and min date from the Solr index ? I would need
> these
> > dates to draw a graph ( for example timeline graph )
> >
> >
> > Also can we use date faceting to show how many documents are indexed
> every
> > month  .
> > Consider I need to draw a timeline graph for current year to show how
> many
> > records are indexed for every month  .So i will have months in X axis and
> no
> > of document in Y axis.
> >
> > What should be the better approach to design a schema to achieve this
> > functionality ?
> >
> >
> > Any suggestions would be appreciated
> >
> > thanks
> >
> >
> > --
> > Nipen Mark
>
>


-- 
Nipen Mark

Re: Getting max/min dates from solr index

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Mark,

Yes, facets will give you that information. Min/max.... StatsComponent?  See http://www.search-lucene.com/?q=StatsComponent

 Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Hadoop ecosystem search :: http://search-hadoop.com/



----- Original Message ----
> From: Mark N <ni...@gmail.com>
> To: solr-user@lucene.apache.org
> Sent: Wed, February 10, 2010 8:12:43 AM
> Subject: Getting max/min dates from solr index
> 
> How can we get the max and min date from the Solr index ? I would need these
> dates to draw a graph ( for example timeline graph )
> 
> 
> Also can we use date faceting to show how many documents are indexed every
> month  .
> Consider I need to draw a timeline graph for current year to show how many
> records are indexed for every month  .So i will have months in X axis and no
> of document in Y axis.
> 
> What should be the better approach to design a schema to achieve this
> functionality ?
> 
> 
> Any suggestions would be appreciated
> 
> thanks
> 
> 
> -- 
> Nipen Mark


Re: Getting max/min dates from solr index

Posted by Jan Høydahl / Cominvent <ja...@cominvent.com>.
How about a field indextime_dt filled with "NOW". Then do a facet query to get the montly stats last 12 months:
http://localhost:8983/solr/select/?q=*:*&rows=0&facet=true&facet.date=indextime_dt&facet.date.start=NOW/MONTH-12MONTHS&facet.date.end=NOW/MONTH%2B1MONTH&facet.date.gap=%2B1MONTH

To get min date, why not do a query sorted by index time and pull the timestamp from first hit?
http://localhost:8983/solr/select/?q=*:*&rows=1&fl=indextime_dt&sort=indextime_dt+asc

--
Jan Høydahl  - search architect
Cominvent AS - www.cominvent.com

On 10. feb. 2010, at 14.12, Mark N wrote:

> How can we get the max and min date from the Solr index ? I would need these
> dates to draw a graph ( for example timeline graph )
> 
> 
> Also can we use date faceting to show how many documents are indexed every
> month  .
> Consider I need to draw a timeline graph for current year to show how many
> records are indexed for every month  .So i will have months in X axis and no
> of document in Y axis.
> 
> What should be the better approach to design a schema to achieve this
> functionality ?
> 
> 
> Any suggestions would be appreciated
> 
> thanks
> 
> 
> -- 
> Nipen Mark