First, the answer/reference here might be exactly what you are looking for.

On the other hand, perhaps you just want to relate natural algebro-geometric structure to the classical Euler characteristic. Here is one way to do that:

A pure Hodge structure of weight $k$ is a finite dimensional complex vector space $V$ such that $V=\bigoplus_{k=p+q} H^{p,q}$ where $H^{q,p}=\overline{H^{p,q}}$. This gives rise to a descending filtration
$F^{p}=\bigoplus_{s\ge p}H^{s,k-s}$. Define $\mathrm{Gr}^{p}_{F}(V)=F^{p}/ F^{p+1}=H^{p,k-p}$.

A mixed Hodge structure is a finite dimensional complex vector space $V$ with a real ascending *weight* filtration $\cdots \subset W_{k-1}\subset W_k \subset \cdots \subset V$ and a descending *Hodge* filtration $F$ such that $F$ induces a pure Hodge structure of weight $k$ on each $\mathrm{Gr}^{W}_{k}(V)=W_{k}/W_{k-1}$. Then define $H^{p,q}= \mathrm{Gr}^{p}_{F}\mathrm{Gr}^{W}_{p+q}(V)$ and $h^{p,q}(V) =\dim H^{p,q}$.

Let $Z$ be any quasi-projective algebraic variety. The cohomology groups with compact support $H^k_c(Z)$ are endowed with mixed Hodge structures by seminal work of Pierre Deligne.

The *Hodge numbers* of $Z$ are $h^{k,p,q}_{c}(Z)= h^{p,q}(H_{c}^k(Z))$, and the $E$-polynomial is defined as
$$
E(Z; u,v)=\sum _{p,q,k} (-1)^{k}h^{k,p,q}_{c}(Z) u^{p}v^{q}.
$$

From this, one gets the classical Euler characteristic $\chi(Z)=E(Z;1,1)$.

Note: if the counting function of $Z$ over finite fields is a polynomial in the order of the finite field, then $E(Z)$ is exactly the counting polynomial. From this point-of-view, in this case, the Euler characteristic is the number of $\mathbb{F}_1$-points.

smoothflat family the fibres are diffeomorphic by Ehresmann theorem, so the topological Euler number is constant. But if the family is not smooth, it can definitely vary (think of a smooth plane cubic degenerating to a nodal one). $\endgroup$5more comments