Cross mail from GitHub :
My search for link apps in various third-party services like Delicious, Twitter ... I have a base class:
class Link include Mongoid::Document include Tire::Model::Search include Tire::Model::Callbacks field :href, type: String field :name, type: String mapping do indexes :href, type: 'string', analyzer: 'url' indexes :name, type: 'string', analyzer: 'keyword', boost: 10 end end
and the next class inherits from Link and adds two more fields:
class Link::Delicious < Link field :tags, type: Array field :time, type: Time mapping do indexes :tags, type: 'string', analyzer: 'keyword' indexes :time, type: 'date' end end
Searches will be performed through the base class: Link.search('google.com') . Is there a chance to get this job? Currently (optional) fields in Link::Delicious completely ignored by Tire / ElasticSearch.
source share