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)
Sat, Dec 7, 10:46 PM
Unknown Object (File)
Thu, Dec 5, 8:41 PM
Unknown Object (File)
Wed, Nov 27, 4:23 PM
Unknown Object (File)
Tue, Nov 19, 2:10 PM
Unknown Object (File)
Nov 14 2024, 9:56 AM
Unknown Object (File)
Oct 27 2024, 7:26 AM
Unknown Object (File)
Oct 19 2024, 11:55 PM
Unknown Object (File)
Oct 19 2024, 8:19 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
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3349
Build 3356: [Placeholder Plan] Wait for 30 Seconds

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.