Not at all like refractive index. Basically, you use a dye that changes color with pH, then measure that color with a meter instead of the eye. Litmus paper is one example. pH test strips used by diabetics and many others is another. pHydrion is a brand. Those dyes can also be used in solids (rarely), gels, and liquids. Their main limitation (like all pH measurements) is that the liquid must be mostly (>>90%) water for them to be accurate.
I once witnessed a "professor" at a small college use the papers to test the pH of some bio-diesel he had made. The pH was always around neutral and he wondered why. I suggested taking some of his diesel, some water, mix them, and then measure the water. It came out quite alkaline. The dyes will not give you the precision of an electrode. At best, you will be +/- 0.5 pH or so. Maybe better with a spectrophotometer. (PS: His Mercedes also suffered engine damage.)
John