且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

发现其中包含由子集使用RavenDB和LINQ的至少一种元素的对象

更新时间:2021-12-23 21:56:43

您可以查询Lucene来获得相匹配侑标签阿雷阵列像这样的标签问题:

You can query lucene to get the questions with tags that match yor tag aray array something like this:

string[] tags = new[] { "a", "b" };
string queryRange = "(" + string.Join(" OR ", tags) + ")";

var res = session.Advanced.LuceneQuery<Question>()
               .Where("Tags:" + queryRange).ToList();

请注意,此查询整个索引的问题,而不是一个子集。但我认为你可以追加 - 我想 - 要查询字符串EX pression。 见Lucene的文档获取更多关于这种类型的查询: 的http://lucene.apache.org/core/old_versioned_docs/versions/3_0_0/queryparsersyntax.html

Note that this queries the entire indexed questions, not a subset. But I think you can append - I GUESS - to the query string expression. See Lucene docs for more about these kind of queries: http://lucene.apache.org/core/old_versioned_docs/versions/3_0_0/queryparsersyntax.html