views:

130

answers:

2
Traceback (most recent call last):

  File "D:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 280, in run
    self.finish_response()

  File "D:\Python25\Lib\site-packages\django\core\servers\basehttp.py", line 319, in finish_response
    for data in self.result:

  File "D:\Python25\Lib\site-packages\django\http\__init__.py", line 374, in __iter__
    self._iterator = iter(self._container)

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 240, in __iter__
    return iter(self._get_data())

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 404, in _get_data
    self._result_cache = list(self._get_results())

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 530, in _get_results
    results = self._get_sphinx_results()

  File "D:\zjm_code\sphinx_test\djangosphinx\models.py", line 517, in _get_sphinx_results
    raise SearchError, client.GetLastError()

SearchError: connection to localhost;3312 failed ((10061, 'Connection refused'))

and next is my code:

from sphinx_test.models import File
from djangosphinx.models import SphinxSearch
def xx(request):
    return HttpResponse(File.search.query('test'))


urlpatterns = patterns('',
    (r'^$',xx),
)
A: 

You don't use a semicolon to separate host and port, you use a colon: i.e. localhost:3312 instead of localhost;3312.

LeafStorm
+1  A: 

What version of sphinx? django-sphinx? There has been a change in the port that is used by sphinx as setup in sphinx.conf.

The searchd now runs on 127.0.0.1:9312. You can of course change this port in sphinx.con. Restart your searchd after you do so.

MovieYoda