lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-6302) Adding Date Math support to Lucene Expressions module
Date Thu, 26 Feb 2015 16:45:04 GMT

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

ASF GitHub Bot commented on LUCENE-6302:
----------------------------------------

GitHub user synhershko opened a pull request:

    https://github.com/apache/lucene-solr/pull/129

    Adding now() support to expressions

    calling now() in an expression will return an epoch value as numeric,
    which could then be used to run expressions against the current
    milliseconds since epoch value
    
    See https://issues.apache.org/jira/browse/LUCENE-6302 for more details

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/synhershko/lucene-solr now-method-in-expressions

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/129.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #129
    
----
commit d6f7b0e378716e58913e085ecf458de83f97590d
Author: Itamar Syn-Hershko <itamar@code972.com>
Date:   2015-02-26T16:36:13Z

    Adding now() support to expressions
    
    calling now() in an expression will return an epoch value as numeric,
    which could then be used to run expressions against the current
    milliseconds since epoch value

----


> Adding Date Math support to Lucene Expressions module
> -----------------------------------------------------
>
>                 Key: LUCENE-6302
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6302
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/expressions
>    Affects Versions: 4.10.3
>            Reporter: Itamar Syn-Hershko
>
> Lucene Expressions are great, but they don't allow for date math. More specifically,
they don't allow to infer date parts from a numeric representation of a date stamp, nor they
allow to parse strings representations to dates.
> Some of the features requested here easy to implement via ValueSource implementation
(and potentially minor changes to the lexer definition) , some are more involved. I'll be
happy if we could get half of those in, and will be happy to work on a PR for the parts we
can agree on.
> The items we will be happy to have:
> - A now() function (with or without TZ support) to return a current long date/time value
as numeric, that we could use against indexed datetime fields (which are infact numerics)
> - Parsing methods - to allow to express datetime as strings, and / or read it from stored
fields and parse it from there. Parse errors would render a value of zero.
> - Given a numeric value, allow to specify it is a date value and then infer date parts
- e.g. Date(1424963520).Year == 2015, or Date(now()) - Date(1424963520).Year. Basically methods
which return numerics but internally create and use Date objects.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message