[ 
https://issues.apache.org/jira/browse/SOLR-10303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15954260#comment-15954260
 ] 

Joel Bernstein commented on SOLR-10303:
---------------------------------------

I really like the design of this. A couple things to think about:

1) Let's create the concept of a TupleContext, which the SelectStream passes to 
each evaluator. This will allow us to share LocalDateTime instance across 
date/time evaluators. The logic would be: check to see if the LocalDateTime for 
a specific field is already in the TupleContext, and use it rather then parsing 
a new Instant. The SelectStream would clear the TupleContext after each Tuple 
is read. This will speed up:

{code}
select(expr,
          year(field1) as year,
          month(field1) as month,
          day(field1) as day)
{code}

2) I think we only need to support two formats to parse from: the date string 
format and the Long epoch time. 

> Add date/time Stream Evaluators
> -------------------------------
>
>                 Key: SOLR-10303
>                 URL: https://issues.apache.org/jira/browse/SOLR-10303
>             Project: Solr
>          Issue Type: New Feature
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Joel Bernstein
>         Attachments: SOLR-10303.patch
>
>
> This ticket will add Stream Evaluators that extract date/time values from a 
> Solr date field. The following Evaluators will be supported:
> hour (date)
> minute (date)
> month (date) 
> monthname(date) 
> quarter(date) 
> second (date)
> year(date)
> Syntax:
> {code}
> select(id,
>        year(recdate) as year,
>        month(recdate) as month,
>        day(recdate) as day,
>        search(logs, q="blah", fl="id, recdate", sort="recdate asc", 
> qt="/export"))
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to