本文整理汇总了C#中Lucene.Net.Search.Vectorhighlight.FieldQuery.expand方法的典型用法代码示例。如果您正苦于以下问题:C# FieldQuery.expand方法的具体用法?C# FieldQuery.expand怎么用?C# FieldQuery.expand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.Vectorhighlight.FieldQuery
的用法示例。
在下文中一共展示了FieldQuery.expand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestExpand
public void TestExpand()
{
Query dummy = PqF("DUMMY");
FieldQuery fq = new FieldQuery(dummy, true, true);
// "a b","b c" => "a b","b c","a b c"
HashSet<Query> flatQueries = new HashSet<Query>();
flatQueries.Add(PqF("a", "b"));
flatQueries.Add(PqF( "b", "c" ));
AssertCollectionQueries(fq.expand(flatQueries),
PqF("a", "b"), PqF("b", "c"), PqF("a", "b", "c"));
// "a b","b c d" => "a b","b c d","a b c d"
flatQueries = new HashSet<Query>();
flatQueries.Add(PqF("a", "b"));
flatQueries.Add(PqF("b", "c", "d"));
AssertCollectionQueries(fq.expand(flatQueries),
PqF("a", "b"), PqF("b", "c", "d"), PqF("a", "b", "c", "d"));
// "a b c","b c d" => "a b c","b c d","a b c d"
flatQueries = new HashSet<Query>();
flatQueries.Add(PqF("a", "b", "c"));
flatQueries.Add(PqF("b", "c", "d"));
AssertCollectionQueries(fq.expand(flatQueries),
PqF("a", "b", "c"), PqF("b", "c", "d"), PqF("a", "b", "c", "d"));
// "a b c","c d e" => "a b c","c d e","a b c d e"
flatQueries = new HashSet<Query>();
flatQueries.Add(PqF("a", "b", "c"));
flatQueries.Add(PqF("c", "d", "e"));
AssertCollectionQueries(fq.expand(flatQueries),
PqF("a", "b", "c"), PqF("c", "d", "e"), PqF("a", "b", "c", "d", "e"));
// "a b c d","b c" => "a b c d","b c"
flatQueries = new HashSet<Query>();
flatQueries.Add(PqF("a", "b", "c", "d"));
flatQueries.Add(PqF("b", "c"));
AssertCollectionQueries(fq.expand(flatQueries),
PqF("a", "b", "c", "d"), PqF("b", "c"));
// "a b b","b c" => "a b b","b c","a b b c"
flatQueries = new HashSet<Query>();
flatQueries.Add(PqF("a", "b", "b"));
flatQueries.Add(PqF("b", "c"));
AssertCollectionQueries(fq.expand(flatQueries),
PqF("a", "b", "b"), PqF("b", "c"), PqF("a", "b", "b", "c"));
// "a b","b a" => "a b","b a","a b a", "b a b"
flatQueries = new HashSet<Query>();
flatQueries.Add(PqF("a", "b"));
flatQueries.Add(PqF("b", "a"));
AssertCollectionQueries(fq.expand(flatQueries),
PqF("a", "b"), PqF("b", "a"), PqF("a", "b", "a"), PqF("b", "a", "b"));
// "a b","a b c" => "a b","a b c"
flatQueries = new HashSet<Query>();
flatQueries.Add(PqF("a", "b"));
flatQueries.Add(PqF("a", "b", "c"));
AssertCollectionQueries(fq.expand(flatQueries),
PqF("a", "b"), PqF("a", "b", "c"));
}
示例2: TestExpandNotFieldMatch
public void TestExpandNotFieldMatch()
{
Query dummy = PqF("DUMMY");
FieldQuery fq = new FieldQuery(dummy, true, false);
// f1:"a b",f2:"b c" => f1:"a b",f2:"b c",f1:"a b c"
HashSet<Query> flatQueries = new HashSet<Query>();
flatQueries.Add(Pq(F1, "a", "b"));
flatQueries.Add(Pq(F2, "b", "c"));
AssertCollectionQueries(fq.expand(flatQueries),
Pq(F1, "a", "b"), Pq(F2, "b", "c"), Pq(F1, "a", "b", "c"));
}