0

My settings seem correct and work:

# Haystack configuration
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://127.0.0.1:9200/',
        'INDEX_NAME': 'haystack',
    },
}
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'

Here is my search indexes:

import datetime
from haystack import indexes
from srt.models import Issue

class IssueIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
title = indexes.CharField(model_attr='issue_title')
tracking = indexes.CharField(model_attr='tracking')

def get_model(self):
    return Issue

def index_queryset(self, using=None):
    """Used when the entire index for model is updated."""
    return self.get_model().objects.filter(date_added__lte=datetime.datetime.now())

and my issue_text.txt:

{{ object.issue_title }}
{{ object.tracking }}

But now, when I'm triggering:

$ python manage.py rebuild_index

I get this error:

InvalidJsonResponseError: <Response [403]>

If someone knows why?

EDIT: When I disconnect my network (disable my network adapters), I get:

Failed to clear Elasticsearch index: Cannot connect to proxy. Socket error: [Errno -3] Temporary failure in name resolution.
All documents removed.
/home/vagrant/.virtualenvs/srt_project/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py:827: RuntimeWarning: DateTimeField received a naive datetime (2013-11-14 14:35:21.821719) while time zone support is active.
  RuntimeWarning)

Indexing 1 issues
ProxyError: Cannot connect to proxy. Socket error: [Errno -3] Temporary failure in name resolution.

Thank you.

4

0 回答 0