Once that’s all done, it’s time to set up an index on your model. In the example below, we’re assuming the model is the Article class.
Please don’t forget that fields and attributes must reference columns from your model database tables, not methods. Sphinx talks directly to your database when indexing, and so the logic in your models doesn’t have any impact.
The next step is to index your data:
You will see a warning like the following – it’s safe to ignore, it’s just Sphinx being overly fussy.
Once that’s done, let’s fire Sphinx up so we can query against it:
And now we can search!
Of course, that’s an extremely simple overview. It’s definitely worth reading some more for a better understanding of the best ways to index and search.