Beispiel #1
0
        public virtual void  TestOneMatchQuery()
        {
            System.Int32      tempAux  = 1000;
            System.Int32      tempAux2 = 1000;
            NumericRangeQuery q        = NumericRangeQuery.NewIntRange("ascfield8", 8, tempAux, tempAux2, true, true);

            Assert.AreSame(MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, q.GetRewriteMethod());
            TopDocs topDocs = searcher.Search(q, noDocs);

            ScoreDoc[] sd = topDocs.ScoreDocs;
            Assert.IsNotNull(sd);
            Assert.AreEqual(1, sd.Length, "Score doc count");
        }
        public virtual void  TestOneMatchQuery()
        {
            System.Int64 tempAux = 1000L;
            //UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
            System.Int64      tempAux2 = 1000L;
            NumericRangeQuery q        = NumericRangeQuery.NewLongRange("ascfield8", 8, tempAux, tempAux2, true, true);

            Assert.AreSame(MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE, q.GetRewriteMethod());
            TopDocs topDocs = searcher.Search(q, noDocs);

            ScoreDoc[] sd = topDocs.scoreDocs;
            Assert.IsNotNull(sd);
            Assert.AreEqual(1, sd.Length, "Score doc count");
        }