Index Time
  • 11 Dec 2024
  • 2 Minutes to read
  • Dark
    Light

Index Time

  • Dark
    Light

Article summary

You may find that you need to search through records indexed within a specific time range. You may do so with using the index time fields.

There are four options:

  • two are based on UTC date/time
  • two are based on server local date/time
  • two are based on the first time a URI was indexed
  • two are based on the most recent update to that URI (which could be the first time it was indexed)

These four options are below:

  • psfirstindex: first date/time (server local time) an item was indexed
  • pslatestindex: most recent update (server local time)
  • indextime: first date/time (UTC date/time) an item was indexed
  • updatetime: most recent update (UTC date/time)

As with all date-time searches, the format is yyyy-mm-dd hh:mm:ss—with or without the punctuation or space. The search server always uses the first four digits as the year gets progressively granular in the above order. It cannot skip elements of the date or time.


Searching for Single Date or Time Range

As with all date-time searches, if you are searching for a single date or time range, using TO is not required.

The below search provides you with all records indexed on November 18, 2024:

indextime:[2024-11-18]

The search below returns all records indexed on 2024/11/18 between 08:00:00.000 - 08:59:59.999--inclusive

indextime:[2024-11-18 08]

Performing Partial Boundary Searches

To perform searching using a partial year, enter up to the first two characters of that year. This is true with all date-time searches.

The following returns anything during the 2020s:

indextime:[202]  

Below returns anything from 2000 to 2099:

indextime:[20]

Including in the Parse Table

In order for the fields to work, they need to have a parsetable for ps:record. Before adding these fields to the parse table, verify they are not already included. Contact Professional Services if you need help with this.

Note:

Any time a new field is added to the parse table, records that are already fed into the SearchServer are not affected; only new records are tagged with the new field. A full refeed is needed to include all records.

The ps-searchserver service must be restarted for any changes to take effect.

 <!-- Default entry for the security field and record envelope -->
  <ps:record>

. . .

    <field name="psfirstindex" type="datetime" format="YYYY-MM-DD hh:mm:ss">
      <tag name="ps:indextime" />
    </field>
    <field name="pslatestindex" type="datetime" format="YYYY-MM-DD hh:mm:ss">
      <tag name="ps:latestindex" />
    </field>
    <field name="indextime" type="datetime" format="YYYY-MM-DD hh:mm:ss">
      <tag name="ps:indextime_utc" />
    </field>
    <field name="updatetime" type="datetime" format="YYYY-MM-DD hh:mm:ss">
      <tag name="ps:latestindex_utc" />

Was this article helpful?