【发布时间】:2021-03-06 09:41:49
【问题描述】:
我正在尝试按照教程进行操作 - http://ethen8181.github.io/machine-learning/search/bm25_intro.html#ElasticSearch-BM25
我通过作为守护程序运行成功启动了我的弹性节点,它在发出查询时确实做出了响应 - curl -X GET "localhost:9200/
当我在这里尝试运行以下代码时,它返回 400。
settings = {
'settings': {
'index': {
'number_of_shards': 1,
'number_of_replicas': 1,
'similarity': {
'default': {
'type': 'BM25'
}
}
}
},
'mappings': {
'_doc': {
'properties': {
'title': {
'type': 'text',
'analyzer': 'english'
}
}
}
}
}
headers = {'Content-Type': 'application/json'}
response = requests.put('http://localhost:9200/experiment', data=json.dumps(settings), headers=headers)
response
我在这里做错了什么,我该如何解决?
我基本上是在尝试索引一组文档并使用 BM25 排名功能检索它们。
【问题讨论】:
标签: python elasticsearch search full-text-search search-engine