我正在使用java 1.7.0_95
,Django 1.8.4
,Python 3.4.0
,Django Rest Framework 3.1.3
,ElasticSearch 2.3.1
,pyelasticsearch 1.4
和Django Haystack 2.4.1
每次尝试python manage.py 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 :(得分:4)
有一个相关的django-haystack
问题需要删除boost
> = 2中不再支持的ElasticSearch
参数:
在更改之前,django-haystack
在_boost
后端的映射中使用了ElasticSearch
参数。对主分支进行了更改。你现在可以做的事情:
直接从github安装django-haystack
的开发版本:
pip install -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack
在升级到第二版之前将ElasticSearch
降级到最新的稳定版本,我认为是1.7.3
另外,以下是相关讨论: