Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Multi-index support per model - consider it experimental, though there are
- # specs and features, and it's been tested with the delayed and datetime delta
- # gems as well.
- define_index do
- # base index
- end
- define_index 'custom' do
- # extra index named 'custom'
- end
- # You *must* provide a custom name for for your model, and they must be unique
- # within the model. The default one is named the same as your model, so don't
- # call it that.
- # Also, whatever the name is, the core index for it is custom_core, and the
- # delta index (if there is one) is custom_delta. There isn't actually an index
- # just called 'custom' (if we're working with the above example).
- # So keep that in mind when it comes to searching. By default, a search on a
- # model will look at all indexes for that model. If you want to limit it to just
- # one:
- Model.search "pancakes", :index => "custom_core"
- # And multiple indexes need to be comma-separated:
- Model.search "pancakes", :index => "custom_core,custom_delta"
Add Comment
Please, Sign In to add comment