Can't index link.title and link.description because "link" seems to name conflict with something in Thinking Sphinx

28 views
Skip to first unread message

soheildb

unread,
Sep 11, 2012, 5:40:36 PM9/11/12
to thinkin...@googlegroups.com
I have the following define_index method:
  
define_index do
    indexes content
    indexes tags.content, :as => :tag_content
    indexes link.title

    has :is_private
    has :user_id
    has :created_at
  end

When I index I get the following error:
WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method ThinkingSphinx::Index::Builder#link called at /Users/azamtaghipoor/pakrat/Pakrat/app/models/user_post.rb:64:in `block in <class:UserPost>'
rake aborted!
wrong number of arguments (1 for 2)

I've already tried :link, :link:title :link.title and similar variations

without the indexes link.title all works fine.
Any help would be much appreciated
Thanks,
Soheil

Pat Allan

unread,
Sep 11, 2012, 7:10:03 PM9/11/12
to thinkin...@googlegroups.com
Rake adds a link method at a global level to Ruby, which is really frustrating. Try the following:

indexes assoc(:link).title, :as => :link_title

Cheers

--
Pat

> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/thinking-sphinx/-/FZp80UO-FPQJ.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.



soheildb

unread,
Sep 12, 2012, 11:48:59 PM9/12/12
to thinkin...@googlegroups.com
Yeah that did it, thanks a lot!!
Reply all
Reply to author
Forward
0 new messages