solr - 我不知道如何在 solr 的字段中通过查询找到单词的确切位置?
问题描述
我的问题解决起来很复杂,我在我的 debian 9 虚拟机中安装了 solr,目的是进行插入海量数据测试。具体通过脚本
垃圾箱/帖子
它将所有 pdf 和 doc 文件上传到我在 solr 中的集合中。我的问题是在内容中进行查询时,我的结果是整个内容,而不是告诉我结果在哪里。我想通过查询知道单词或句子到底在哪里。
例如:
"content":["This is my \nfirst test\n This is my \nfirst test\n This is my \nfirst test\n This is my \nfirst test\n This is my \nfirst test \n"], "metadata.X-Parsed-By":["org.apache.tika.parser.DefaultParser", "org.apache.tika.parser.txt.TXTParser"], "metadata.Content-Encoding":["ISO-8859-1"], "metadata.resourceName":["tika_extract.py"], "metadata.Content-Type":["text/x-python; charset=ISO-8859-1"], "id":"4ebba9d3-239c-494d-9a1f-9ec16610530b", "_version_":1630918290423414784},
询问:
{content: "test"}
我目前的结果是:
"content":["This is my \nfirst test\n This is my \nfirst test\n This is my \nfirst test\n This is my \nfirst test\n This is my \nfirst test \n"]
我需要这个结果:
"content": ["这是我的\n第一个测试\n这是我的\n第一个 测试\n这是我的\n第一个测试\n这是我的\n第一个测试\n这是我的\n第一个测试\ n"]
我的主要目标是只知道匹配词在内容或整个句子中的位置,其他替代方案不是问题。
等待我的问题得到最好的解释。
解决方案
推荐阅读
- maven - 即使我所有的测试都通过了,我也看到了surefire错误的错误,没有与surefire插件相关的答案对我有帮助
- javascript - 地理定位后使用javascript生成随机纬度和经度
- arrays - 谷歌表格 - 基于相应单元格范围内的数值连接单元格范围内文本的公式
- python - 如何在 Tkinter 中设置最大值?
- c++ - 为什么在包含 boost 标头 (g++) 时出现“没有这样的文件或目录”错误
- mongodb - Mongo go驱动程序-在连接启用ssl和加密密钥时出现密钥不匹配错误
- javascript - Javascript - 获取两个数组之间的对应对象
- javascript - 尝试使用 Vue.js 访问 Stack Oveflow Api 出现错误
- android - 如何修复无法读取序列化文件指纹。在数据流中发现无法识别的值
- python - Django 无法登录用户