示例#1
0
        private DocIdSetIterator GetDISI(Filter filter, AtomicReaderContext context)
        {
            // we dont pass acceptDocs, we will filter at the end using an additional filter
            DocIdSet docIdSet = filter.GetDocIdSet(context, null);

            if (docIdSet == null)
            {
                return(DocIdSetIterator.Empty());
            }
            else
            {
                DocIdSetIterator iter = docIdSet.GetIterator();
                if (iter == null)
                {
                    return(DocIdSetIterator.Empty());
                }
                else
                {
                    return(iter);
                }
            }
        }
示例#2
0
        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: private void doChain(org.apache.lucene.util.FixedBitSet result, int logic, org.apache.lucene.search.DocIdSet dis) throws java.io.IOException
        private void doChain(FixedBitSet result, int logic, DocIdSet dis)
        {
            if (dis is FixedBitSet)
            {
                // optimized case for FixedBitSets
                switch (logic)
                {
                case OR:
                    result.Or((FixedBitSet)dis);
                    break;

                case AND:
                    result.And((FixedBitSet)dis);
                    break;

                case ANDNOT:
                    result.AndNot((FixedBitSet)dis);
                    break;

                case XOR:
                    result.Xor((FixedBitSet)dis);
                    break;

                default:
                    doChain(result, DEFAULT, dis);
                    break;
                }
            }
            else
            {
                DocIdSetIterator disi;
                if (dis == null)
                {
                    disi = DocIdSetIterator.Empty();
                }
                else
                {
                    disi = dis.GetIterator() ?? DocIdSetIterator.Empty();
                }

                switch (logic)
                {
                case OR:
                    result.Or(disi);
                    break;

                case AND:
                    result.And(disi);
                    break;

                case ANDNOT:
                    result.AndNot(disi);
                    break;

                case XOR:
                    result.Xor(disi);
                    break;

                default:
                    doChain(result, DEFAULT, dis);
                    break;
                }
            }
        }