Kalendae
Kalendae

Reputation: 2244

SOLR: how to see when document/row was last indexed?

is there anyway to get a timestamp of when a document/row was last updated or indexed? sort of like the fields created_at or updated_at for activerecord.

Upvotes: 1

Views: 1298

Answers (1)

Paige Cook
Paige Cook

Reputation: 22555

As Ben commented, there is not a built in way to do this. The only option would be to create the following timestamp field in your schema. Then this value would always be the last time that the document/row was last indexed.

    <field name="timestamp" type="date" indexed="true" 
         stored="true" default="NOW" multiValued="false"/>

This is taken from the example schema.xml that ships with Solr.

Upvotes: 2

Related Questions