Re: Facet by truncated date

2016-03-31 Thread Emir Arnautovic

Hi Rob,
Range is mandatory, and you should limit it since it will create too 
much buckets. I agree it would be great if it could use min/max values 
from query as start/end, but that is not how it works at the moment.


Regards,
Emir

On 31.03.2016 11:32, Robert Brown wrote:

Hi Emir,

What if I don't want to specify a range?  Or would I have to do year 0 
to NOW?


Thanks,
Rob


On 03/31/2016 10:26 AM, Emir Arnautovic wrote:

Hi Yago,
Not sure if I misunderstood the case, but assuming you have date 
field called my_date you can facet last 10 days by day using range 
queries:


?facet.range=my_date=NOW/DAY-10DAYS=NOW/DAY+1DAY=+1DAY 



Regards,
Emir

On 31.03.2016 11:14, Yago Riveiro wrote:
If you want aggregate the dat by the truncated date, I think the 
only way to

do it is using other field with the truncated date.


You can use a update request processor to calculate the truncated data
(https://wiki.apache.org/solr/UpdateRequestProcessor) or add the 
field in

indexing time.


date:"2016-03-31T12:00:0Z"

truncated_date_s:'2016-03-31' or truncated_date_i:20160331 (this 
should be

more memory efficient)

\--


/Yago Riveiro


![](https://link.nylas.com/open/m7fkqw0yim04itb62itnp7r9/4708d221e9a24b519bab6 


3936013ce59)

On Mar 31 2016, at 10:08 am, Emir Arnautovic
emir.arnauto...@sematext.com wrote:


Hi Robert,

You can use range faceting and set use facet.range.gap to set how dates
are "truncated".


Regards,

Emir


On 31.03.2016 10:52, Robert Brown wrote:

 Hi,

 Is it possible to facet by a date (solr.TrieDateField) but 
truncated

 to the day, or even the hour?

 If not, are there any other options apart from storing that 
truncated

 data in another (string?) field?

 Thanks,
 Rob




\--

Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr  Elasticsearch Support * 








--
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/



Re: Facet by truncated date

2016-03-31 Thread Robert Brown

Hi Emir,

What if I don't want to specify a range?  Or would I have to do year 0 
to NOW?


Thanks,
Rob


On 03/31/2016 10:26 AM, Emir Arnautovic wrote:

Hi Yago,
Not sure if I misunderstood the case, but assuming you have date field 
called my_date you can facet last 10 days by day using range queries:


?facet.range=my_date=NOW/DAY-10DAYS=NOW/DAY+1DAY=+1DAY 



Regards,
Emir

On 31.03.2016 11:14, Yago Riveiro wrote:
If you want aggregate the dat by the truncated date, I think the only 
way to

do it is using other field with the truncated date.


You can use a update request processor to calculate the truncated data
(https://wiki.apache.org/solr/UpdateRequestProcessor) or add the 
field in

indexing time.


date:"2016-03-31T12:00:0Z"

truncated_date_s:'2016-03-31' or truncated_date_i:20160331 (this 
should be

more memory efficient)

\--


/Yago Riveiro


![](https://link.nylas.com/open/m7fkqw0yim04itb62itnp7r9/4708d221e9a24b519bab6 


3936013ce59)

On Mar 31 2016, at 10:08 am, Emir Arnautovic
emir.arnauto...@sematext.com wrote:


Hi Robert,

You can use range faceting and set use facet.range.gap to set how dates
are "truncated".


Regards,

Emir


On 31.03.2016 10:52, Robert Brown wrote:

 Hi,

 Is it possible to facet by a date (solr.TrieDateField) but 
truncated

 to the day, or even the hour?

 If not, are there any other options apart from storing that 
truncated

 data in another (string?) field?

 Thanks,
 Rob




\--

Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr  Elasticsearch Support * 








Re: Facet by truncated date

2016-03-31 Thread Yago Riveiro
Emir,

  

I assume that this query will create N ranges (one for each day) and give you
the counts, in this case it works indeed. I'm confess that never use facet
ranges before.

  

What output will give the range query? The result of the ranges or the dates
truncated with the counts?

  
\--

  

/Yago Riveiro

  

![](https://link.nylas.com/open/m7fkqw0yim04itb62itnp7r9/eae9e3a3308049849ef01
3655c85f3ba)

On Mar 31 2016, at 10:26 am, Emir Arnautovic
emir.arnauto...@sematext.com wrote:  

> Hi Yago,  
Not sure if I misunderstood the case, but assuming you have date field  
called my_date you can facet last 10 days by day using range queries:

>

> ?facet.range=my_datefacet.range.start=NOW/DAY-
10DAYSfacet.range.end=NOW/DAY+1DAYfacet.range.gap=+1DAY

>

> Regards,  
Emir

>

> On 31.03.2016 11:14, Yago Riveiro wrote:  
 If you want aggregate the dat by the truncated date, I think the only way
to  
 do it is using other field with the truncated date.  
  
  
  
 You can use a update request processor to calculate the truncated data  
 (https://wiki.apache.org/solr/UpdateRequestProcessor) or add the field in  
 indexing time.  
  
  
  
 date:"2016-03-31T12:00:0Z"  
  
 truncated_date_s:'2016-03-31' or truncated_date_i:20160331 (this should
be  
 more memory efficient)  
  
 \\--  
  
  
  
 /Yago Riveiro  
  
  
  

![](https://link.nylas.com/open/m7fkqw0yim04itb62itnp7r9/4708d221e9a24b519bab6  
 3936013ce59)  
  
 On Mar 31 2016, at 10:08 am, Emir Arnautovic  
 lt;emir.arnauto...@sematext.comgt; wrote:  
  
 Hi Robert,  
 You can use range faceting and set use facet.range.gap to set how dates  
 are "truncated".  
  
 Regards,  
 Emir  
  
 On 31.03.2016 10:52, Robert Brown wrote:  
 gt; Hi,  
 gt;  
 gt; Is it possible to facet by a date (solr.TrieDateField) but
truncated  
 gt; to the day, or even the hour?  
 gt;  
 gt; If not, are there any other options apart from storing that
truncated  
 gt; data in another (string?) field?  
 gt;  
 gt; Thanks,  
 gt; Rob  
 gt;  
 gt;  
  
 \\--  
 Monitoring * Alerting * Anomaly Detection * Centralized Log Management  
 Solr amp; Elasticsearch Support * http://sematext.com/;  
  


>

> \--  
Monitoring * Alerting * Anomaly Detection * Centralized Log Management  
Solr  Elasticsearch Support * 



Re: Facet by truncated date

2016-03-31 Thread Emir Arnautovic

Hi Yago,
Not sure if I misunderstood the case, but assuming you have date field 
called my_date you can facet last 10 days by day using range queries:


?facet.range=my_date=NOW/DAY-10DAYS=NOW/DAY+1DAY=+1DAY

Regards,
Emir

On 31.03.2016 11:14, Yago Riveiro wrote:

If you want aggregate the dat by the truncated date, I think the only way to
do it is using other field with the truncated date.

   


You can use a update request processor to calculate the truncated data
(https://wiki.apache.org/solr/UpdateRequestProcessor) or add the field in
indexing time.

   


date:"2016-03-31T12:00:0Z"

truncated_date_s:'2016-03-31' or truncated_date_i:20160331 (this should be
more memory efficient)

\--

   


/Yago Riveiro

   


![](https://link.nylas.com/open/m7fkqw0yim04itb62itnp7r9/4708d221e9a24b519bab6
3936013ce59)

On Mar 31 2016, at 10:08 am, Emir Arnautovic
emir.arnauto...@sematext.com wrote:


Hi Robert,

You can use range faceting and set use facet.range.gap to set how dates
are "truncated".


Regards,

Emir


On 31.03.2016 10:52, Robert Brown wrote:

 Hi,

 Is it possible to facet by a date (solr.TrieDateField) but truncated
 to the day, or even the hour?

 If not, are there any other options apart from storing that truncated
 data in another (string?) field?

 Thanks,
 Rob




\--

Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr  Elasticsearch Support * 




--
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/



Re: Facet by truncated date

2016-03-31 Thread Yago Riveiro
If you want aggregate the dat by the truncated date, I think the only way to
do it is using other field with the truncated date.

  

You can use a update request processor to calculate the truncated data
(https://wiki.apache.org/solr/UpdateRequestProcessor) or add the field in
indexing time.

  

date:"2016-03-31T12:00:0Z"

truncated_date_s:'2016-03-31' or truncated_date_i:20160331 (this should be
more memory efficient)

\--

  

/Yago Riveiro

  

![](https://link.nylas.com/open/m7fkqw0yim04itb62itnp7r9/4708d221e9a24b519bab6
3936013ce59)

On Mar 31 2016, at 10:08 am, Emir Arnautovic
emir.arnauto...@sematext.com wrote:  

> Hi Robert,  
You can use range faceting and set use facet.range.gap to set how dates  
are "truncated".

>

> Regards,  
Emir

>

> On 31.03.2016 10:52, Robert Brown wrote:  
 Hi,  
  
 Is it possible to facet by a date (solr.TrieDateField) but truncated  
 to the day, or even the hour?  
  
 If not, are there any other options apart from storing that truncated  
 data in another (string?) field?  
  
 Thanks,  
 Rob  
  


>

> \--  
Monitoring * Alerting * Anomaly Detection * Centralized Log Management  
Solr  Elasticsearch Support * 



Re: Facet by truncated date

2016-03-31 Thread Emir Arnautovic

Hi Robert,
You can use range faceting and set use facet.range.gap to set how dates 
are "truncated".


Regards,
Emir

On 31.03.2016 10:52, Robert Brown wrote:

Hi,

Is it possible to facet by a date (solr.TrieDateField) but truncated 
to the day, or even the hour?


If not, are there any other options apart from storing that truncated 
data in another (string?) field?


Thanks,
Rob




--
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/