elasticsearch - Elasticsearch“match_phrase_prefix”无法正常工作
问题描述
我有一个自定义分析器:
"s5_analyzer": {
"filter": "lowercase",
"type": "custom",
"tokenizer": "whitespace"
}
和映射:
"PRODUCT": {
"type": "text",
"fields": {
"keyw": {
"type": "text",
"analyzer": "s5_analyzer"
}
}
}
有了记录"PRODUCT": "the brown fox jumped2:, over 1200 the lazy dog"
,我正在使用这个查询:
{
"query": {
"match_phrase_prefix": {
"PRODUCT.keyw": {
"query": "the brown fox"
}
}
}
}
这些查询正常工作,结果即将到来
"query": "the brow"
"query": "the brown"
"query": "the brown fox"
但是通过这些查询我没有结果:
"query": "the brown f"
"query": "the brown fo"
"query": "the bro"
我的索引只有一条记录,所以max_expansions
不是问题。为什么match_phrase_prefix
不能正常工作?
Elasticsearch 版本是 7.10.2
谢谢。
解决方案
推荐阅读
- ios - 更改不同屏幕上的导航栏颜色和标题颜色
- python - Python:从csv中提取特定行作为列表
- reactjs - 使用 react-loadable、react-router-dom 和 redux 进行代码拆分
- java - 服务器-套接字到套接字通信
- cordova - 离子文件传输上传错误代码3
- angular - 如何链接多个 API 调用
- html - 边框重叠 li 的孩子和子孩子
- c# - 带有 post 方法的 wcf RESTful Web 服务
- nlp - Chris Manning 很棒”,标签“PER PER O O”将变为 ([[1,9], [2,9], [3,8], [4,8]], [1, 1, 4, 4] ). "chris" 如何在 [1,9] 中编码?
- c# - 返回并调用多个数组