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 fjq <fq...@gmail.com> on 2015/03/27 04:39:56 UTC

solr server datetime

Is it possible to retrieve the server datetime?



--
View this message in context: http://lucene.472066.n3.nabble.com/solr-server-datetime-tp4195728.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: solr server datetime

Posted by fjq <fq...@gmail.com>.
Erick,

Thank you very much, the ms(NOW) was all I needed.

Best,

Fabricio
Em sex, 27 de mar de 2015 às 15:26, Erick Erickson [via Lucene] <
ml-node+s472066n4195883h93@n3.nabble.com> escreveu:

> Why do you want to in the first place? I ask because it's a common
> trap to think the server time is something that is useful...
>
> That said, it would require a little fiddling, but you can return the
> number of milliseconds since January 1, 1970 (standard Unix epoch) by
> adding ms(NOW) to your fl parameter. The general case here is that you
> can add the results of any function query to the fl list.
>
> You could use a DocTransformer, here's a place to start:
>
> https://cwiki.apache.org/confluence/display/solr/Transforming+Result+Documents
>
> There may be more elegant ways, but that one is easy.
>
> Best,
> Erick
>
> On Thu, Mar 26, 2015 at 8:39 PM, fjq <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4195883&i=0>> wrote:
> > Is it possible to retrieve the server datetime?
> >
> >
> >
> > --
> > View this message in context:
> http://lucene.472066.n3.nabble.com/solr-server-datetime-tp4195728.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/solr-server-datetime-tp4195728p4195883.html
>  To unsubscribe from solr server datetime, click here
> <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4195728&code=ZnF1aW50ZWxhQGdtYWlsLmNvbXw0MTk1NzI4fDk0MzAwNzkw>
> .
> NAML
> <http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://lucene.472066.n3.nabble.com/solr-server-datetime-tp4195728p4195923.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: solr server datetime

Posted by Erick Erickson <er...@gmail.com>.
Why do you want to in the first place? I ask because it's a common
trap to think the server time is something that is useful...

That said, it would require a little fiddling, but you can return the
number of milliseconds since January 1, 1970 (standard Unix epoch) by
adding ms(NOW) to your fl parameter. The general case here is that you
can add the results of any function query to the fl list.

You could use a DocTransformer, here's a place to start:
https://cwiki.apache.org/confluence/display/solr/Transforming+Result+Documents

There may be more elegant ways, but that one is easy.

Best,
Erick

On Thu, Mar 26, 2015 at 8:39 PM, fjq <fq...@gmail.com> wrote:
> Is it possible to retrieve the server datetime?
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/solr-server-datetime-tp4195728.html
> Sent from the Solr - User mailing list archive at Nabble.com.