Skip to content

Inheritance and indexing #1038

@chris-roerig

Description

@chris-roerig

Hi Pat,

I was wondering if it's possible to index a child model and if so, what configurations and "gotchas" should I look out for?

Example:

Class A < ActiveRecord::Base
end

Class B < A
  self.table_name = "bs"
end


ThinkingSphinx::Index.define :b, with: :active_record, delta: ThinkingSphinx::Deltas::SidekiqDelta do
...
end

I'm attempting this but getting this message:
(notice both class tables are being referenced)

index a_core,a_delta,b_core,b_delta: query error: no field 'sphinx_internal_class_name' found in schema - SELECT * FROM `a_core`, `a_delta`, `b_core`, `b_delta` WHERE MATCH('@sphinx_internal_class_name (B)') AND `sphinx_deleted` = 0 ORDER BY `id` desc LIMIT 0, 10000 OPTION max_matches=10000; SHOW META

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions