2016-04-23 51 views
3

我使用java 1.7.0_95Django 1.8.4Python 3.4.0Django Rest Framework 3.1.3ElasticSearch 2.3.1pyelasticsearch 1.4Django Haystack 2.4.1MapperParsingException在Django的草垛與elasticsearch

每次我嘗試做python manage.py rebuild_index時間我經歷elasticsearch錯誤做rebuild_index。這是錯誤:

 
MapperParsingException[Root mapping definition has unsupported parameters: [_boost : {null_value=1.0, name=boost}]] 
     at org.elasticsearch.index.mapper.DocumentMapperParser.checkNoRemainingFields(DocumentMapperParser.java:171) 
     at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:159) 
     at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:99) 
     at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:498) 
     at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:257) 
     at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:230) 
     at org.elasticsearch.cluster.service.InternalClusterService.runTasksForExecutor(InternalClusterService.java:468) 
     at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:772) 
     at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:231) 
     at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:194) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
     at java.lang.Thread.run(Thread.java:745) 

這裏是我的配置:

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' 

HAYSTACK_SEARCH_RESULTS_PER_PAGE = 40 
+0

沒有'ElasticSearch 1.9.0'。 –

+0

感謝您指出@AndreiStefan,我在我的問題中將其修正爲2.3.1。必須把它和其他東西混合起來。 –

回答

4

有一個相關的django-haystack問題刪除boost參數,因此不再在ElasticSearch> = 2的支持:

在更改之前,django-haystackElasticSearch後端的映射中使用_boost參數。對主分支進行了更改。你可以在這個時刻做的事情:

  • 直接從github上安裝的django-haystack開發版:

    pip install -e git+https://github.com/toastdriven/[email protected]#egg=django-haystack 
    
  • 降級ElasticSearch在升級到2日前最新的穩定版本,我認爲這爲1.7.3

而且,這裏是相關討論:

+0

感謝@alecxe,工作!感謝你的幫助 :-) –