简体   繁体   English

使用elasticsearch在django-haystack中执行rebuild_index时的MapperParsingException

[英]MapperParsingException on doing rebuild_index in django-haystack with elasticsearch

I'm using 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 我正在使用java 1.7.0_95Django 1.8.4Python 3.4.0Django Rest Framework 3.1.3ElasticSearch 2.3.1pyelasticsearch 1.4Django Haystack 2.4.1

I'm experiencing an error in elasticsearch every time I try to do python manage.py rebuild_index . 每次我尝试执行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)

Here is my 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'

HAYSTACK_SEARCH_RESULTS_PER_PAGE = 40

There is a relevant django-haystack issue to remove the boost parameter which is no longer supported in ElasticSearch >= 2: 有一个相关的django-haystack问题来删除在ElasticSearch > = 2中不再支持的boost参数:

Before that change, django-haystack was using the _boost parameter in the mapping for the ElasticSearch backend. 在更改之前, django-haystackElasticSearch后端的映射中使用了_boost参数。 The change was made to the master branch. 对主分支进行了更改。 You can do things at this moment: 你现在可以做的事情:

  • install the development version of django-haystack directly from github: 直接从github安装django-haystack的开发版本:

     pip install -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack 
  • downgrade ElasticSearch to the latest stable version before the upgrade to the 2nd, I think it is 1.7.3 在升级到第二版之前将ElasticSearch降级到最新的稳定版本,我认为它是1.7.3

Also, here is the relevant discussion: 另外,这里是相关的讨论:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM