像“IN”这样的等号运算符是什么?用于 LUCENE.NET 的 SQL Server
我如何在 LUCENE.NET 中获得“IN”(SQL Server 的)功能?
假设存在一些记录,其 ID 为:a,b,c,d,e,f,..
所以我想使用 Lucene 获取 ('a','b','c') 中的记录。网。
请让我知道如何在 Lucene.net 中编写此查询。
提前致谢。
How can i get " IN " (of SQL Server) functionality in LUCENE.NET?
Suppose assume that some records are exist with ID : a,b,c,d,e,f,..
So I want to get the records which are in ('a','b','c') by using Lucene.net.
Please let me know how can i write this query in Lucene.net.
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要将 BooleanQuery 与 SHOULD 子句一起使用。
这意味着任何结果都必须具有 ID = a、b 或 c。
You need to use a BooleanQuery with the SHOULD clause.
This means that any result must have either ID = a, b, or c.
查询 q = new QueryParser("ID", new YourAnalyzer()).Parse("abc d") :)
Query q = new QueryParser("ID", new YourAnalyzer()).Parse("a b c d") :)