查找所有具有特定字段的 Lucene 文档 [英] Find all Lucene documents having a certain field

查看:19
本文介绍了查找所有具有特定字段的 Lucene 文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在索引中查找具有某个字段的所有文档,而不管该字段的值如何.尽可能使用查询语言,而不是 API.

I want to find all documents in the index that have a certain field, regardless of the field's value. If at all possible using the query language, not the API.

有办法吗?

推荐答案

如果您知道字段中存储的数据类型,可以尝试范围查询.例如,如果您的字段包含字符串数据,则像 field:[a* TO z*] 这样的查询将返回该字段中有字符串值的所有文档.

If you know the type of data stored in your field, you can try a range query. Per example, if your field contain string data, a query like field:[a* TO z*] would return all documents where there is a string value in that field.

这篇关于查找所有具有特定字段的 Lucene 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆