indexes shop.created_at,:as =>created_at has shop(:created_at),:as => :created_at has shop.created_at,:as => :created_at
谢谢.
解决方法
索引用于指定字段 – 根据Thinking Sphinx网站:
Fields are the content for your search queries – so if you want words tied to a specific document,you better make sure they’re in a field in your index. They are only string data – you could have numbers and dates and such in your fields,but Sphinx will only treat them as strings,nothing else.
has用于指定属性 – 再次,根据Thinking Sphinx网站:
Attributes are used for sorting,filtering and grouping your search results. Their values do not get paid any attention by Sphinx for search terms,though,and they’re limited to the following data types: integers,floats,datetimes (as Unix timestamps – and thus integers anyway),booleans,and strings. Take note that string attributes are converted to ordinal integers,which is especially useful for sorting,but not much else.