0

Is there anything in the tire gem similar to the attributes (has) of indexing in Thinking_Sphinx attributes Does the filters of tire serve the same purpose? Please help me in this issue.

Vamsi Krishna
  • 3,742
  • 4
  • 20
  • 45

1 Answers1

0

I'm not particularly familiar with Thinking Sphinx but...

Check out here:

https://github.com/karmi/tire

class Article < ActiveRecord::Base
  # ...

  def to_indexed_json
    names      = author.split(/\W/)
    last_name  = names.pop
    first_name = names.join

    {
      :title   => title,
      :content => content,
      :author  => {
        :first_name => first_name,
        :last_name  => last_name
      }
    }.to_json
  end
end

Supplying custom definitions in your index allows you to use the :as functionality in the link that you sent.

In order to filter you'll need to add a filter and then apply it, by a facet for example.

ezis
  • 311
  • 2
  • 10