Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6092305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:25:37+00:00 2026-05-23T12:25:37+00:00

While setting up Sphinx on my production server, this strange error came up when

  • 0

While setting up Sphinx on my production server, this strange error came up when trying to index

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

This doesn’t happen on my local machine. And yes, that is an empty string.

Does anyone seen this type of issue before?

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

Sphinx – 0.9.9

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:25:38+00:00Added an answer on May 23, 2026 at 12:25 pm

    The problem ended up being with the sanitize_sql method. I replaced that line with:

    where "active = true AND expiration > \"#{Time.now.to_formatted_s(:db)}\""
    

    Thanks for the help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have strange discarding behavior of struts2 while setting cache option for my image.
I'm trying to do a redirect while setting the flash[:error] value. (Rails 3.0.10) In
I keep getting this error while setting up ehcache in Spring MVC. org.springframework.beans.factory.BeanCreationException: Error
While setting up an online file management system, and now I have hit a
I have problem while setting the Jlabel location. I set the content pane to
m getting error while setting these properties of red. Does anybody here knows how
While setting up Hudson for continous integration testing (on a JeOS server), I've come
I have a wx.Frame that has only a single child. While setting up the
I'm trying to include the font KaiTi while setting text on the clipboard, so
I have a problem while setting a private attribute on a PHP class, my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.