0

I'm set up Sphinx and indexed my table. It works correctly in the console, but how i can execute this query in java? Is it possible? I guess Intellij Idea doesn't understand SphinxQL.

  • Hello, can you add example code and any errors you are getting. – John Mercier Mar 31 '19 at 19:41
  • @JohnMercier Hi, `String sql = "SELECT * FROM searchIndex WHERE MATCH('@text qweqwe')"; rs = st.executeQuery(sql);` Unexpected '', 'AGAINST' expected Error:java: java.lang.ExceptionInInitializerError – Dmitry Goncharuk Mar 31 '19 at 20:03

1 Answers1

0

how i can execute this query in java?

Just work with that as with MySQL (in terms of connection). Few notes:

  • prepared statements are not supported in Sphinx
  • make sure you connect to correct Sphinx's port
  • if you cannot connect try mysql_version_string = 5.5.21

As for the error you see in the IDE - it's probably just because it thinks it's MySQL. Sphinx understands mysql protocol, but the query syntax is different.

Manticore Search
  • 1,462
  • 9
  • 9