gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 15:02:04 26 4
gpt4 key购买 nike

我正在使用 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

每次尝试执行 python manage.py rebuild_index 时,elasticsearch 都会遇到错误。这是错误:

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

最佳答案

有一个相关的 django-haystack 问题可以删除 boost 参数,ElasticSearch 不再支持该参数 >= 2:

在此更改之前,django-haystackElasticSearch 后端的映射中使用 _boost 参数。对 master 分支进行了更改。此时你可以做的事情:

  • 直接从 github 安装 django-haystack 的开发版本:

    pip install -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack
  • 降级ElasticSearch到最新的稳定版再升级到2nd,我觉得是1.7.3

此外,这里是相关的讨论:

关于python - MapperParsingException 在使用 elasticsearch 在 django-haystack 中执行 rebuild_index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36813348/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com