问题
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
I'm experiencing an error in elasticsearch every time I try to do 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
回答1:
There is a relevant django-haystack
issue to remove the boost
parameter which is no longer supported in ElasticSearch
>= 2:
- Remove boost which is now unsupported
Before that change, 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:
install the development version of
django-haystack
directly from github: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
Also, here is the relevant discussion:
- Django haystack LocationField created as string instead of geo_point in elasticsearch
来源:https://stackoverflow.com/questions/36813348/mapperparsingexception-on-doing-rebuild-index-in-django-haystack-with-elasticsea