Latesh G. wrote:
> Am using acts_as_taggable_on_steroids plugin. I have a book model
> which has tags. As there anyway I can index tags with define_index
> directive so that sphinx searches for title or tag at once?

Depending on your schema (I'm not familiar with the particular plugin),
you probably have 3 options.

- index by tag name
- add the tag id to the index as a multi-value attribute (MVA)
- both of the above

In my app with tags, I'm using both approaches - they both have their
advantages in different situations.

To add the tag name to my index, I use the following in my define_index
block:

    tags.name, :as => "tags"

To add the IDs as an MVA I have:

    has tags(:id), :as => :tag_ids

That's all very schema dependant, but hopefully it gives you some ideas
on how to approach it.

-- James Healy <jimmy-at-deefa-dot-com>  Tue, 24 Mar 2009 21:15:26 +1100

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to