【发布时间】:2011-06-30 18:55:53
【问题描述】:
在我的生产服务器上设置 Sphinx 时,尝试索引时出现了这个奇怪的错误
ERROR: index 'benefit_core': sql_range_query: You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near '' at line 1
这不会发生在我的本地机器上。是的,这是一个空字符串。
以前有人见过这类问题吗?
benefit.rb
define_index do
# Fields
indexes category
indexes title
indexes tags
indexes description
indexes brief_description
indexes brand
indexes short_description
indexes long_description
indexes benefit_description
indexes address.city
indexes address.state
indexes address.street_1
where sanitize_sql(["active = true and expiration > ?", Time.now])
set_property :field_weights => {
:title => 15,
:tags => 10,
:brand => 10,
:description => 3
}
end
Thinking-Sphinx - 1.4.4
狮身人面像 - 0.9.9
谢谢!
【问题讨论】:
-
请从您的模型中发布您的查询和您的 define_index 块。
-
@Dex 我添加了模型的define_index。索引期间发生错误,所以我什至没有机会测试查询。
-
什么时候看到错误?你跑了
rake ts:config和rake ts:rebuild
标签: mysql ruby-on-rails sphinx thinking-sphinx