3

I'm working with thinking sphinx

    define_index do
        indexes to
        indexes created_on
        has created_on
    end

now while searching on console

    Emaildumps.search 5.day.ago,
    :group_by => 'created_on',
    :group_function => :day

now the error i get is

     Sphinx Daemon returned error: index emaildumps_core: INTERNAL ERROR: incoming-schema mismatch (in=timestamp created_on:32@160, my=timestamp created_on:32@0)

it may be a dumb question but i'm a newbee at sphinx and i can't understand the fundamentals of indexing and searching in it

what am I doing wrong??

so please help me out.

1 Answers1

7

It's perhaps related, but you can't have fields and attributes with the same name. So, I'd recommend aliasing one of those (the field is better):

define_index do
  indexes to
  indexes created_on, :as => :created_on_field
  has created_on
end

That said, not sure if there's much value in having created_on as a field, but up to you.

pat
  • 16,116
  • 5
  • 40
  • 46
  • Thanks @pat! It would be good if TS warned about this issue when reading an index file though. :) – bodacious Mar 25 '16 at 15:58
  • 1
    @bodacious https://github.com/pat/thinking-sphinx/commit/992eb7a388be8b99f5525ceb0571edbaedd11575 - just added this commit to the develop branch :) – pat Mar 26 '16 at 01:18