Skip to content

Instantly share code, notes, and snippets.

@otobrglez
Created August 29, 2014 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otobrglez/e2ba9cf1e61febd17546 to your computer and use it in GitHub Desktop.
Save otobrglez/e2ba9cf1e61febd17546 to your computer and use it in GitHub Desktop.
ElasticSearch - Mapping / Settings example
module FilmSearch
extend ActiveSupport::Concern
included do
include Elasticsearch::Model
include Elasticsearch::Model::Callbacks
mapping do
indexes "title", type: 'string', analyzer: 'snowball'
indexes "signing.starts_at", type: 'date', format: 'basic_date'
end
settings do
#TODO: Add analysers and other settings here.
end
end
end
class Film
include FilmSearch
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment