An in-fiber Bragg grating (FBG) sensor for refractive index (RI) measurement is proposed and experimentally demonstrated by using an optoelectronic oscillator (OEO). The index sensor device is an etched phase-shifted fiber Bragg grating (PS-FBG) with a radius of $27.5~\mu \text{m}$ . In the OEO loop, the PS-FBG is exposed to different liquid samples via evanescent field interaction of the guided fiber mode. Since the RI change can introduce a shift to the center wavelength of the PS-FBG, the center frequency of the OEO will change. Therefore, the variation of the ambient RI can be estimated by measuring the oscillating frequency change. Since the oscillating microwave signal can be measured by a digital signal processor at a high resolution, the OEO-based sensor is able to provide RI measurement at an ultra-high resolution. The proposed measurement method is experimentally evaluated. The sensor has a sensitivity of 530 MHz/RIU and can detect an index variation of $1.9 \times 10^{-6}$ RIU.