Page MenuHomePhabricator

Ensure dateCreated property exists at index creation time
ClosedPublic

Authored by WikiChad on Dec 30 2014, 5:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 2:50 PM
Unknown Object (File)
Mon, Apr 15, 1:16 PM
Unknown Object (File)
Fri, Apr 5, 7:29 PM
Unknown Object (File)
Tue, Apr 2, 7:46 AM
Unknown Object (File)
Mar 14 2024, 3:26 AM
Unknown Object (File)
Feb 10 2024, 8:14 AM
Unknown Object (File)
Feb 4 2024, 2:37 AM
Unknown Object (File)
Feb 3 2024, 1:37 AM
Subscribers

Details

Summary

Since the default query will sort on this when no query string is
attached we want to make sure the property at least exists.

Otherwise Elasticsearch yells at you: "No mapping found for [dateCreated]
in order to sort on" when you try to search for documents that haven't
been indexed yet.

Test Plan

Searched for Mocks and Initiatives (no such documents exist in my index)
and got the error. After patching and reinitializing the index, the error
during querying went away.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

WikiChad retitled this revision from to Ensure dateCreated property exists at index creation time.
WikiChad updated this object.
WikiChad edited the test plan for this revision. (Show Details)
epriestley added a reviewer: epriestley.

Is "string" the best type for this field? We store an epoch timestamp in it, so I'd naively expect "int" or maybe "epoch". Shoot me a followup if that makes any sense.

This revision is now accepted and ready to land.Dec 30 2014, 10:46 AM
This revision was automatically updated to reflect the committed changes.

We could probably do better than string, but that's what the index was doing during automatic mapping creation anyway so I figured the status quo was ok for now.