  The first binary neutron star merger, GW170817, was accompanied by a
radioactivity-powered optical/infrared transient called a kilonova. To date, no
compelling kilonova has been found during optical surveys of the sky,
independent of gravitational-wave triggers. In this work, we searched the first
23 months of the Zwicky Transient Facility (ZTF) data stream for candidate
kilonovae in the form of rapidly evolving transients. We combined ZTF alert
queries with forced point-spread-function photometry and nightly flux stacking
to increase our sensitivity to faint and fast transients. Automatic queries
yielded $>11,200$ candidates, 24 of which passed quality checks and strict
selection criteria based on a grid of kilonova models tailored for both binary
neutron star and neutron star-black hole mergers. None of the candidates in our
sample was deemed a possible kilonova after thorough vetting, catalog
cross-matching, and study of their color evolution. The sources that passed our
selection criteria are dominated by Galactic cataclysmic variables. In
addition, we identified two fast transients at high Galactic latitude, one of
which is the confirmed afterglow of long-duration GRB190106A, and the other is
a possible cosmological afterglow. Using a survey simulation code, we
constrained the kilonova rate for a range of models including top-hat and
linearly decaying light curves and synthetic light curves obtained with
radiative transfer simulations. For prototypical GW170817-like kilonovae, we
constrain the rate to be $R < 1775$ Gpc$^{-3}$ yr$^{-1}$ at 95% confidence
level by requiring at least 2 high-significance detections. By assuming a
population of kilonovae with the same geometry and composition of GW170817
observed under a uniform viewing angle distribution, we obtained a constraint
on the rate of $R < 4029$ Gpc$^{-3}$ yr$^{-1}$.
