本文整理汇总了C#中Lucene.Net.Search.DisjunctionMaxQuery.Weight方法的典型用法代码示例。如果您正苦于以下问题:C# DisjunctionMaxQuery.Weight方法的具体用法?C# DisjunctionMaxQuery.Weight怎么用?C# DisjunctionMaxQuery.Weight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Search.DisjunctionMaxQuery
的用法示例。
在下文中一共展示了DisjunctionMaxQuery.Weight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSkipToFirsttimeMiss
public virtual void TestSkipToFirsttimeMiss()
{
DisjunctionMaxQuery dq = new DisjunctionMaxQuery(0.0f);
dq.Add(Tq("id", "d1"));
dq.Add(Tq("dek", "DOES_NOT_EXIST"));
QueryUtils.Check(dq, s);
Weight dw = dq.Weight(s);
Scorer ds = dw.Scorer(r);
bool skipOk = ds.SkipTo(3);
if (skipOk)
{
Assert.Fail("firsttime skipTo found a match? ... " + r.Document(ds.Doc()).Get("id"));
}
}
示例2: TestSkipToFirsttimeHit
public virtual void TestSkipToFirsttimeHit()
{
DisjunctionMaxQuery dq = new DisjunctionMaxQuery(0.0f);
dq.Add(Tq("dek", "albino"));
dq.Add(Tq("dek", "DOES_NOT_EXIST"));
QueryUtils.Check(dq, s);
Weight dw = dq.Weight(s);
Scorer ds = dw.Scorer(r);
Assert.IsTrue(ds.SkipTo(3), "firsttime skipTo found no match");
Assert.AreEqual("d4", r.Document(ds.Doc()).Get("id"), "found wrong docid");
}
示例3: TestSkipToFirsttimeMiss
public virtual void TestSkipToFirsttimeMiss()
{
DisjunctionMaxQuery dq = new DisjunctionMaxQuery(0.0f);
dq.Add(Tq("id", "d1"));
dq.Add(Tq("dek", "DOES_NOT_EXIST"));
QueryUtils.Check(dq, s);
Weight dw = dq.Weight(s);
Scorer ds = dw.Scorer(r, true, false);
bool skipOk = ds.Advance(3) != DocIdSetIterator.NO_MORE_DOCS;
if (skipOk)
{
Assert.Fail("firsttime skipTo found a match? ... " + r.Document(ds.DocID()).Get("id"));
}
}