问题描述
我正在使用 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 [根映射定义具有不受支持的参数:[_boost:{null_value = 1.0,name = boost}]]
在org.elasticsearch.index.mapper.DocumentMapperParser.checkNoRemainingFields(DocumentMapperParser.java:171)
在org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:159)
在org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:99)
在org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:498)
在org.elasticsearch .cluster.metadata.MetaDataMappingService $ PutMappingExecutor.applyRequest(MetaDataMappingService.java:257)
在org.elasticsearch.cluster.metadata.MetaDataMappingService $ PutMappingExecutor.execute(MetaDataMappingService.java:230)
在org.elasticsearch .cluster.service.InternalClusterService.runTasksForExecutor(InternalClusterService.java:468)
在org.elasticsearch.cluster.service.InternalClusterService $ UpdateTask.run(InternalClusterService.java:772)
在org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor $ TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEthreadPoolExecutor.java:231)
在org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor $ TieBreakingPrioritizedRunnable.run(PrioritizedEthreadPoolExecutor.java:194)
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)
在java.lang.Thread.run(Thread.java:745)
这是我的配置:
HAYSTACK_CONNECTIONS = {
'default':{
'ENGINE':'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL':'http://127.0.0.1:9200/',
'INDEX_NA ME':'haystack',
},
}
HAYSTACK_SIGNAL_PROCESSOR ='haystack.signals.RealtimeSignalProcessor'
HAYSTACK_SEARCH_RESULTS_PER_PAGE = 40
有一个相关的 在此更改之前, 安装开发版本的 降级 另外,这里是相关的讨论: I'm using I'm experiencing an error in elasticsearch every time I try to do Here is my configuration: There is a relevant Before that change, install the development version of downgrade Also, here is the relevant discussion: 这篇关于MapperParsingException在django-haystack中使用elasticsearch做rebuild_index的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! django-haystack
issue以删除在
中不再支持的 ElasticSearch
> = 2: boost
p>
django-haystack
在 ElasticSearch
后端的映射中使用 _boost
参数。改变主要分支。您现在可以执行以下操作:
django-haystack
直接从github:
pip install -e git + https://github.com/toastdriven/django- haystack.git@master#egg=django-haystack
ElasticSearch
到升级到最新的稳定版本之前,我认为这是
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
and Django Haystack 2.4.1
python manage.py rebuild_index
. This is the error:
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
django-haystack
issue to remove the boost
parameter which is no longer supported in ElasticSearch
>= 2:django-haystack
was using the _boost
parameter in the mapping for the ElasticSearch
backend. The change was made to the master branch. You can do things at this moment:django-haystack
directly from github:pip install -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack
ElasticSearch
to the latest stable version before the upgrade to the 2nd, I think it is 1.7.3