示例#1
0
        public virtual void TestInverseRange()
        {
            AtomicReaderContext      context = (AtomicReaderContext)SlowCompositeReaderWrapper.Wrap(Reader).Context;
            NumericRangeFilter <int> f       = NumericRangeFilter.NewInt32Range("field8", 8, 1000, -1000, true, true);

            Assert.IsNull(f.GetDocIdSet(context, (context.AtomicReader).LiveDocs), "A inverse range should return the null instance");
            f = NumericRangeFilter.NewInt32Range("field8", 8, int.MaxValue, null, false, false);
            Assert.IsNull(f.GetDocIdSet(context, (context.AtomicReader).LiveDocs), "A exclusive range starting with Integer.MAX_VALUE should return the null instance");
            f = NumericRangeFilter.NewInt32Range("field8", 8, null, int.MinValue, false, false);
            Assert.IsNull(f.GetDocIdSet(context, (context.AtomicReader).LiveDocs), "A exclusive range ending with Integer.MIN_VALUE should return the null instance");
        }
        public virtual void  TestInverseRange()
        {
            System.Int64       tempAux  = 1000L;
            System.Int64       tempAux2 = -1000L;
            NumericRangeFilter f        = NumericRangeFilter.NewLongRange("field8", 8, tempAux, tempAux2, true, true);

            Assert.AreSame(DocIdSet.EMPTY_DOCIDSET, f.GetDocIdSet(searcher.GetIndexReader()), "A inverse range should return the EMPTY_DOCIDSET instance");
            //UPGRADE_TODO: The 'System.Int64' structure does not have an equivalent to NULL. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1291'"
            System.Int64 tempAux3 = (long)System.Int64.MaxValue;
            f = NumericRangeFilter.NewLongRange("field8", 8, tempAux3, null, false, false);
            Assert.AreSame(DocIdSet.EMPTY_DOCIDSET, f.GetDocIdSet(searcher.GetIndexReader()), "A exclusive range starting with Long.MAX_VALUE should return the EMPTY_DOCIDSET instance");
            //UPGRADE_TODO: The 'System.Int64' structure does not have an equivalent to NULL. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1291'"
            System.Int64 tempAux4 = (long)System.Int64.MinValue;
            f = NumericRangeFilter.NewLongRange("field8", 8, null, tempAux4, false, false);
            Assert.AreSame(DocIdSet.EMPTY_DOCIDSET, f.GetDocIdSet(searcher.GetIndexReader()), "A exclusive range ending with Long.MIN_VALUE should return the EMPTY_DOCIDSET instance");
        }