Guest User

Untitled

a guest
Apr 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. # Multi-index support per model - consider it experimental, though there are
  2. # specs and features, and it's been tested with the delayed and datetime delta
  3. # gems as well.
  4.  
  5. define_index do
  6. # base index
  7. end
  8.  
  9. define_index 'custom' do
  10. # extra index named 'custom'
  11. end
  12.  
  13. # You *must* provide a custom name for for your model, and they must be unique
  14. # within the model. The default one is named the same as your model, so don't
  15. # call it that.
  16.  
  17. # Also, whatever the name is, the core index for it is custom_core, and the
  18. # delta index (if there is one) is custom_delta. There isn't actually an index
  19. # just called 'custom' (if we're working with the above example).
  20.  
  21. # So keep that in mind when it comes to searching. By default, a search on a
  22. # model will look at all indexes for that model. If you want to limit it to just
  23. # one:
  24.  
  25. Model.search "pancakes", :index => "custom_core"
  26.  
  27. # And multiple indexes need to be comma-separated:
  28.  
  29. Model.search "pancakes", :index => "custom_core,custom_delta"
Add Comment
Please, Sign In to add comment