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

查看:47
本文介绍了查找具有特定字段的所有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天全站免登陆