Sha256: 4dde713cf52a99ccfd90f5978d6b3640406c2c6adc869895c2c6e4f02cad09f4

Contents?: true

Size: 618 Bytes

Versions: 17

Compression:

Stored size: 618 Bytes

Contents

# frozen_string_literal: true

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?
  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

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-5.5.1 spec/internal/app/indices/product_index.rb
thinking-sphinx-5.5.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-5.4.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-5.3.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-5.2.1 spec/internal/app/indices/product_index.rb
thinking-sphinx-5.2.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-5.1.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-5.0.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-4.4.1 spec/internal/app/indices/product_index.rb
thinking-sphinx-4.4.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-4.3.2 spec/internal/app/indices/product_index.rb
thinking-sphinx-4.3.1 spec/internal/app/indices/product_index.rb
thinking-sphinx-4.3.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-4.2.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-4.1.0 spec/internal/app/indices/product_index.rb
thinking-sphinx-4.0.0 spec/internal/app/indices/product_index.rb