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, true, false); Assert.IsTrue(ds.Advance(3) != DocIdSetIterator.NO_MORE_DOCS, "firsttime skipTo found no match"); Assert.AreEqual("d4", r.Document(ds.DocID()).Get("id"), "found wrong docid"); }
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")); } }
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")); } }
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"); }