Multiple searchable blocks

51 views
Skip to first unread message

m3n...@gmail.com

unread,
Oct 10, 2014, 10:37:44 AM10/10/14
to ruby-s...@googlegroups.com
Hi guys,

Someone knows if is it possible to use multiple searchable blocks? Let me explain, I have a Model that already has a searchable block and I want to add more text searchable fields but via metaprogramming. Is it possible?

Rob Kaufman

unread,
Oct 14, 2014, 10:29:51 PM10/14/14
to m3n...@gmail.com, ruby-s...@googlegroups.com
Is there a reason you can’t do you’re meta-programming in the existing search block?  We go so far in one app as to have code in the database so that each instance of the app can have custom search constraints

searchable do
  ….normal search stuff...
    if Custom.additional_quote_group_search
      instance_eval &Custom.additional_quote_group_search
    end
end

Best,

Rob Kaufman

On October 14, 2014 at 17:51:14 , m3n...@gmail.com (m3n...@gmail.com) wrote:

Hi guys,

Someone knows if is it possible to use multiple searchable blocks? Let me explain, I have a Model that already has a searchable block and I want to add more text searchable fields but via metaprogramming. Is it possible?
--
You received this message because you are subscribed to the Google Groups "Sunspot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-sunspot...@googlegroups.com.
To post to this group, send email to ruby-s...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-sunspot.
For more options, visit https://groups.google.com/d/optout.

mstreicher

unread,
Oct 14, 2014, 10:39:20 PM10/14/14
to ruby-s...@googlegroups.com

You can do multiple search blocks. I have a mixin that adds standard searchable fields to other models. 
 

On Oct 10, 2014, at 10:37 AM, m3n...@gmail.com wrote:

Hi guys,

Someone knows if is it possible to use multiple searchable blocks? Let me explain, I have a Model that already has a searchable block and I want to add more text searchable fields but via metaprogramming. Is it possible?

Almir Mendes

unread,
Oct 20, 2014, 10:57:32 AM10/20/14
to Rob Kaufman, ruby-s...@googlegroups.com
Hi Rob,

Thank you for the answer. I'll try like that ;)
Reply all
Reply to author
Forward
0 new messages