In Griffiths Example 4.1, the author derived the polarizability of a uniformly charged spherical cloud with radius $a$. For an external field $E$, the electron cloud will shift to the left with a length of $d$. When the $E_e$ field electron cloud induces matches the external field $E$, we have $$ E = \frac{1}{4\pi\epsilon_0} \frac{qd}{a^3}$$ with $$ p = qd = 4\pi\epsilon_0a^3E $$ thus deriving the polarizability $\alpha$. My question is: What exactly is $d$ in general in a dipole moment $p$ like this? In this problem, the $d$ is the length the center of the electron cloud shifts. But in general, $p$ is defined via the integral (in chapter 3.4) $$ \int r' \rho(r') d\tau'$$ where $q$ is just (EDIT: q should not be the total charge)
$$ q= \int \rho(r') d\tau' $$ is wrong. The total charge is $0$.
and $d$ is also defined in this problem. What is $q$ in general, and why exactly does $p = qd$ hold according to these definitions?
I have an idea: $p=qd$ is for two point electrons, but in this example, we need to regard the electron cloud as a whole $-q$ in its center- and $p=qd$ still holds, for the integral $$\int r' \rho(r') d\tau'$$ does not change if you regard the electron cloud as that.
Is my interpretation correct?