Cross post from GitHub:шин/ElasticSearch Single Table Inheritance
Мой поиск приложение для ссылок в различных услуг третьих лиц, как Delicious, Twitter ... Я ниже базового класса:
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
и следующий класс наследуется от Link
и добавляет еще два поля:
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
Поисковые запросы будет осуществляться с помощью класса Base: Link.search('google.com')
. Есть ли шанс получить эту работу? В настоящий момент (дополнительные) поля в Link::Delicious
полностью игнорируются Tire/ElasticSearch.