Django Oscar弹性搜索没有索引

时间:2017-04-10 18:23:08

标签: django elasticsearch django-oscar

我只是添加了Haystack文档中的配置,

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://127.0.0.1:9200/',
        'INDEX_NAME': 'haystack',
    },
}

我正在使用,

django-haystack==2.5.1
elasticsearch==5.0.1
django-oscar==1.4
Django==1.9.12

当我运行rebuild_index时,它会跳过所有模型,而不是索引 我没有修改奥斯卡的代码

 OSCAR_SEARCH_FACETS = {
    'fields': OrderedDict([
        ('product_class', {'name': ('Type'), 'field': 'product_class'}),
        ('rating', {'name': ('Rating'), 'field': 'rating'}),
    ]),
    'queries': OrderedDict([
        ('price_range',
         {
             'name': ('Price range'),
             'field': 'price',
             'queries': [
                 # This is a list of (name, query) tuples where the name will
                 # be displayed on the front-end.
                 (('0 to 20'), u'[0 TO 20]'),
                 (('20 to 40'), u'[20 TO 40]'),
                 (('40 to 60'), u'[40 TO 60]'),
                 (('60+'), u'[60 TO *]'),
             ]
         }),
    ]),
}

0 个答案:

没有答案