本文整理汇总了C#中Lucene.Net.Search.Vectorhighlight.FieldQuery.flatten方法的典型用法代码示例。如果您正苦于以下问题:C# FieldQuery.flatten方法的具体用法?C# FieldQuery.flatten怎么用?C# FieldQuery.flatten使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.Vectorhighlight.FieldQuery
的用法示例。
在下文中一共展示了FieldQuery.flatten方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestFlatten1TermPhrase
public void TestFlatten1TermPhrase()
{
Query query = PqF("A");
FieldQuery fq = new FieldQuery(query, true, true);
HashSet<Query> flatQueries = new HashSet<Query>();
fq.flatten(query, flatQueries);
AssertCollectionQueries(flatQueries, Tq("A"));
}
示例2: TestFlattenTermAndPhrase
public void TestFlattenTermAndPhrase()
{
Query query = paW.Parse("A AND \"B C\"");
FieldQuery fq = new FieldQuery(query, true, true);
HashSet<Query> flatQueries = new HashSet<Query>();
fq.flatten(query, flatQueries);
AssertCollectionQueries(flatQueries, Tq("A"), PqF("B", "C"));
}
示例3: TestFlattenTermAndPhrase2gram
public void TestFlattenTermAndPhrase2gram()
{
Query query = paB.Parse("AA AND BCD OR EFGH");
FieldQuery fq = new FieldQuery(query, true, true);
HashSet<Query> flatQueries = new HashSet<Query>();
fq.flatten(query, flatQueries);
AssertCollectionQueries(flatQueries, Tq("AA"), PqF("BC", "CD" ), PqF("EF", "FG", "GH"));
}
示例4: testFlattenDisjunctionMaxQuery
public void testFlattenDisjunctionMaxQuery()
{
Query query = Dmq(Tq("A"), Tq("B"), PqF("C", "D"));
FieldQuery fq = new FieldQuery(query, true, true);
HashSet<Query> flatQueries = new HashSet<Query>();
fq.flatten(query, flatQueries);
AssertCollectionQueries(flatQueries, Tq("A"), Tq("B"), PqF("C", "D"));
}
示例5: TestFlattenBoolean
public void TestFlattenBoolean()
{
Query query = paW.Parse("A AND B OR C NOT (D AND E)");
FieldQuery fq = new FieldQuery(query, true, true);
HashSet<Query> flatQueries = new HashSet<Query>();
fq.flatten(query, flatQueries);
AssertCollectionQueries(flatQueries, Tq("A"), Tq("B"), Tq("C"));
}
示例6: TestFlattenPrefixQueryWithAnd
public void TestFlattenPrefixQueryWithAnd()
{
Query query = paW.Parse("Ter* AND Pre*");
FieldQuery fq = new FieldQuery(query, true, true);
HashSet<Query> flatQueries = new HashSet<Query>();
fq.flatten(query, flatQueries);
AssertCollectionQueries(flatQueries, Preq("ter"), Preq("pre"));
}
示例7: TestFlattenSpanQuery
public void TestFlattenSpanQuery()
{
var clauses = new SpanQuery[]
{
new SpanTermQuery(new Term(F, "a")),
new SpanTermQuery(new Term(F, "b")),
new SpanTermQuery(new Term(F, "c")),
};
var query = new SpanNearQuery(clauses, 3, true);
var fieldQuery = new FieldQuery(query, true, true);
var flatQueries = new HashSet<Query>();
fieldQuery.flatten(query, flatQueries);
AssertCollectionQueries(flatQueries, Tq("a"), Tq("b"), Tq("c"));
}
示例8: TestFlattenMultiPhraseQuery
public void TestFlattenMultiPhraseQuery()
{
var query = new MultiPhraseQuery();
query.Add(new[] { new Term(F, "a1"), new Term(F, "a2") });
query.Add(new[] { new Term(F, "b1"), new Term(F, "b2") });
var fieldQuery = new FieldQuery(query, true, true);
var flatQueries = new HashSet<Query>();
fieldQuery.flatten(query, flatQueries);
AssertCollectionQueries(flatQueries, Tq("a1"), Tq("a2"), Tq("b1"), Tq("b2"));
}