Hi Peter The method-with-argument approach for fields and attributes is outdated (I know plenty of old blog posts refer to that style) - chained methods is the right way to go. Also, you can use method calls instead of symbols (so :name just becomes name for your field).
So: > ThinkingSphinx::Index.define :player, :with => :active_record do > indexes name, :as => player_name, :sortable => true > indexes amplua, :sortable => true > > has real_team.name, as => :real_team_name > has amplua.name, as => :amplua > end Can you see if that helps at all? — Pat On 9 Nov 2014, at 2:36 am, Peter Chudinov <[email protected]> wrote: > Hi there! > I am really new to Sphinx and TS, and I get loads of errors and fails here. > Here are my terminal logs > pchudinov:SportFantasy chud$ rake ts:index > /Library/Ruby/Gems/2.0.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:222: > warning: Insecure world writable dir /usr/local in PATH, mode 040777 > Generating configuration to > /Users/chud/SportFantasy/config/development.sphinx.conf > Sphinx 2.2.5-id64-release (r4825) > Copyright (c) 2001-2014, Andrew Aksyonoff > Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com) > > > using config file '/Users/chud/SportFantasy/config/development.sphinx.conf'... > WARNING: key 'sql_query_info' was permanently removed from Sphinx > configuration. Refer to documentation for details. > WARNING: key 'charset_type' was permanently removed from Sphinx > configuration. Refer to documentation for details. > WARNING: key 'sql_query_info' was permanently removed from Sphinx > configuration. Refer to documentation for details. > WARNING: key 'charset_type' was permanently removed from Sphinx > configuration. Refer to documentation for details. > WARNING: key 'sql_query_info' was permanently removed from Sphinx > configuration. Refer to documentation for details. > WARNING: 3 more warnings skipped. > indexing index 'amplua_core'... > collected 12 docs, 0.0 MB > sorted 0.0 Mhits, 100.0% done > total 12 docs, 222 bytes > total 0.028 sec, 7702 bytes/sec, 416.33 docs/sec > indexing index 'player_core'... > ERROR: duplicate attribute name: name > ERROR: index 'player_core': failed to configure some of the sources, will not > index. > indexing index 'real_team_core'... > collected 21 docs, 0.0 MB > sorted 0.0 Mhits, 100.0% done > total 21 docs, 347 bytes > total 0.014 sec, 24543 bytes/sec, 1485.35 docs/sec > indexing index 'user_team_core'... > collected 120 docs, 0.0 MB > sorted 0.0 Mhits, 100.0% done > total 120 docs, 2051 bytes > total 0.019 sec, 107936 bytes/sec, 6315.12 docs/sec > skipping non-plain index 'amplua'... > skipping non-plain index 'player'... > skipping non-plain index 'real_team'... > skipping non-plain index 'user_team'... > total 171 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg > total 36 writes, 0.000 sec, 0.5 kb/call avg, 0.0 msec/call avg > pchudinov:SportFantasy chud$ rake ts:start > /Library/Ruby/Gems/2.0.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:222: > warning: Insecure world writable dir /usr/local in PATH, mode 040777 > Started searchd successfully (pid: 8250). > > My issue is over here: > indexing index 'player_core'... > ERROR: duplicate attribute name: name > ERROR: index 'player_core': failed to configure some of the sources, will not > index. > > And as long as I get it, it results in: > skipping non-plain index 'amplua'... > skipping non-plain index 'player'... > skipping non-plain index 'real_team'... > skipping non-plain index 'user_team'... > > How should I manage to fix it? > > Sources: > > ThinkingSphinx::Index.define :amplua, :with => :active_record do > indexes :name, :as => :ampluas > end > > > ThinkingSphinx::Index.define :player, :with => :active_record do > indexes :name, :as => player_name, :sortable => true > indexes amplua, :sortable => true > > has real_team(:name), as => :real_team_name > has amplua(:name), as => :amplua > end > > > ThinkingSphinx::Index.define :real_team, :with => :active_record do > indexes :name, :as => :real_team_name > end > > > ThinkingSphinx::Index.define :user_team, :with => :active_record do > indexes :name, as => :user_team_name > end > > > > > -- > 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. > For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.
