Sha256: d8377bee96dc14a901b34729215491aa485051d419c7ece0d0f0cbc2d68296be

Contents?: true

Size: 628 Bytes

Versions: 1

Compression:

Stored size: 628 Bytes

Contents

multi_schema = MultiSchema.new

ThinkingSphinx::Index.define :product, :with => :real_time do
  indexes name, :sortable => true

  has category_ids, :type => :integer, :multi => true
  has options, :type => :json if JSONColumn.call
end

if multi_schema.active?
  multi_schema.create 'thinking_sphinx'

  ThinkingSphinx::Index.define(:product,
    :name => :product_two, :offset_as => :product_two, :with => :real_time
  ) do
    indexes name, prefixes: true

    set_property min_prefix_len: 1, dict: :keywords

    scope do
      multi_schema.switch :thinking_sphinx
      User
    end
  end

  multi_schema.switch :public
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinking-sphinx-3.2.0 spec/internal/app/indices/product_index.rb