javascript - 搜索索引 npm
问题描述
我目前正在开发一个 Javascript 项目,我想使用 search-index 来搜索一组不同的 js 对象。它可以工作,但是,它会在主目录的级别 DB 数据库中跟踪所有先前的搜索结果。
我不希望这样,因为用户只会对最近的搜索结果感兴趣。感谢任何可以帮助我在每次搜索后清除数据库或提供类似于搜索索引的方法的人。
我要搜索的对象的基本结构如下。我的主要问题是每个对象都有自己独特的文本路径,我想在每个路径中搜索文本,这就是 search-index 所做的。
[{ dmodule: { identAndStatusSection: [Object], content: [Object] } },
{ dmodule: { identAndStatusSection: [Object], content: [Object] } },
{ dmodule: { identAndStatusSection: [Object], content: [Object] } },
{ dmodule: { identAndStatusSection: [Object], content: [Object] } },
{ dmodule: { identAndStatusSection: [Object], content: [Object] } },
{ dmodule: { identAndStatusSection: [Object], content: [Object] } },
{ dmodule: { identAndStatusSection: [Object], content: [Object] } },
{ dml: { identAndStatusSection: [Object], dmlContent: [Object] } },
{ pm: { identAndStatusSection: [Object], content: [Object] } },
{ pm: { identAndStatusSection: [Object], content: [Object] } },
{ pm: { identAndStatusSection: [Object], content: [Object] } },
{ pm: { identAndStatusSection: [Object], content: [Object] } }]
解决方案
推荐阅读
- c# - 如何在.net中设置多个子复选框
- r - R 代码:如何从小标题列表中提取一列并将其用作函数的参数?
- machine-learning - automl文本分类训练需要多长时间
- php - 在 PHP 中每天递增整数
- r - 从 dplyr summarise() 数据创建并排条形图 [R]
- qt - 如何为 QTextEdit 添加内联注释?
- date - 按每个主题的最早日期对 SAS 数据集进行子集化
- python - 通用匹配和替换仅知道开头和结尾的任意长度模式
- python - 如何在 Python 程序脚本中将 Spark 错误消息保存/写入日志文件?
- jenkins - 没有在 Jenkins 中获取版本号插件值