Hi Michael

This isn't quite as neat, because the fields method on an index is not public:

  indices = 
ThinkingSphinx::Configuration.instance.indices_for_references(:article)
  indices.collect { |index| index.send(:fields).collect &:name  }.flatten.uniq
  indices.collect { |index| index.unique_attribute_names  }.flatten.uniq

-- 
Pat

On 24/02/2013, at 3:29 AM, Michael Wolraich wrote:

> I need to generate a list of fields and attributes for each index. In 2.x, I 
> do that with:
> model.sphinx_indexes.map { |index| index.fields.map &:unique_name }.flatten
> model.sphinx_indexes.map { |index| index.attributes.map &:unique_name 
> }.flatten
> 
> How can I do something similar in 3.x?
> 
> Thanks.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

 

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


Reply via email to