Getting max/min dates from solr index

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting max/min dates from solr index

Mark N
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
Reply | Threaded
Open this post in threaded view
|

Re: Getting max/min dates from solr index

Jan Høydahl / Cominvent
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

Reply | Threaded
Open this post in threaded view
|

Re: Getting max/min dates from solr index

Otis Gospodnetic-2
In reply to this post by Mark N
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 <[hidden email]>
> To: [hidden email]
> 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

Reply | Threaded
Open this post in threaded view
|

Re: Getting max/min dates from solr index

Mark N
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 <
[hidden email]> 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 <[hidden email]>
> > To: [hidden email]
> > 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
Reply | Threaded
Open this post in threaded view
|

Re: Getting max/min dates from solr index

hossman

: 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