semirook/sphinxit

Update for Sphinx 2.19

Opened this issue · 4 comments

Not working for me on my CentOS system with Sphinx 2.19. I suspect that Sphinx 2.19 might have had some changes that broke it.

>>> from sphinxit.core.helpers import BaseSearchConfig
>>> from sphinxit.core.processor import Search
>>> search_query = Search(indexes=['sourcecode'], config=BaseSearchConfig)
>>> search_query.ask()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sphinxit/core/processor.py", line 287, in ask
    return self.connector.execute(query_batch)
  File "sphinxit/core/connector.py", line 149, in execute
    raise SphinxQLDriverException(e)
sphinxit.core.exceptions.SphinxQLDriverException: u'Variable_name'

Confirm. I've got same thing with Sphinx 2.1.9.

Use WITH_META = False and WITH_STATUS = False in config

Perhaps it's fixed by @dixon-che, check it, please.

Same problem here with Sphinx 2.2.5-id64-release (r4825) running on Debian Linux.

mysql -P 9306 -h 127.0.0.1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 2.2.5-id64-release (r4825)
Python 2.7.9 (default, Mar  1 2015, 18:22:53) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from sphinxit.core.processor import Search
>>> class SphinxitConfig(object):
...     DEBUG = True
...     WITH_META = True
...     WITH_STATUS = True
...     POOL_SIZE = 5
...     SQL_ENGINE = 'oursql'
...     SEARCHD_CONNECTION = {
...         'host': '127.0.0.1',
...         'port': 9306,
...     }
... 
>>> search_query = Search(indexes=['merchants'], config=SphinxitConfig)
>>> search_query = search_query.match('aeroflot')
>>> search_result = search_query.ask()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/www/python-envs/test.com/local/lib/python2.7/site-packages/sphinxit/core/processor.py", line 287, in ask
    return self.connector.execute(query_batch)
  File "/var/www/python-envs/test.com/local/lib/python2.7/site-packages/sphinxit/core/connector.py", line 149, in execute
    raise SphinxQLDriverException(e)
sphinxit.core.exceptions.SphinxQLDriverException: u'Variable_name'

Switching to mysql engine instead of oursql does not help as well.

>>> from sphinxit.core.processor import Search
>>> class SphinxitConfig(object):
...     DEBUG = True
...     WITH_META = True
...     WITH_STATUS = True
...     POOL_SIZE = 5
...     SQL_ENGINE = 'mysql'
...     SEARCHD_CONNECTION = {
...             'host': '127.0.0.1',
...             'port': 9306,
... }
... 
>>> search_query = search_query.match('aeroflot')
>>> search_result = search_query.ask()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/www/python-envs/test.com/local/lib/python2.7/site-packages/sphinxit/core/processor.py", line 287, in ask
    return self.connector.execute(query_batch)
  File "/var/www/python-envs/test.com/local/lib/python2.7/site-packages/sphinxit/core/connector.py", line 149, in execute
    raise SphinxQLDriverException(e)
sphinxit.core.exceptions.SphinxQLDriverException: u'Variable_name'
$ pip freeze
Django==1.8
Jinja2==2.7.3
MarkupSafe==0.23
MySQL-python==1.2.5
Pillow==2.8.1
South==1.0.2
Unidecode==0.04.17
argparse==1.2.1
awesome-slugify==1.6.2
awscli==1.7.19
bcdoc==0.13.0
boto==2.36.0
botocore==0.100.0
colorama==0.3.3
django-autocomplete-light==2.1.0rc2
django-common-helpers==0.6.4
django-cron==0.3.6
django-debug-toolbar==1.3.0
django-jinja==1.1.1
django-mptt==0.7.1
django-pylibmc==0.5.0
docutils==0.12
jmespath==0.6.1
ordereddict==1.1
oursql==0.9.3.1
psycopg2==2.6
pyasn1==0.1.7
pylibmc==1.4.1
python-dateutil==2.4.2
python-memcached==1.54
pytz==2015.2
regex==2015.03.18
rsa==3.1.4
six==1.9.0
sphinxit==0.3.2
sqlparse==0.1.14
uWSGI==2.0.10
virtualenv==12.1.1
wsgiref==0.1.2
WITH_STATUS = False

Fix this