Esempio n. 1
0
            public virtual PulsingDocsEnum Reset(IBits liveDocs, PulsingTermState termState)
            {
                if (Debugging.AssertsEnabled)
                {
                    Debugging.Assert(termState.PostingsSize != -1);
                }

                // Must make a copy of termState's byte[] so that if
                // app does TermsEnum.next(), this DocsEnum is not affected
                if (_postingsBytes is null)
                {
                    _postingsBytes = new byte[termState.PostingsSize];
                }
                else if (_postingsBytes.Length < termState.PostingsSize)
                {
                    _postingsBytes = ArrayUtil.Grow(_postingsBytes, termState.PostingsSize);
                }
                System.Array.Copy(termState.Postings, 0, _postingsBytes, 0, termState.PostingsSize);
                _postings.Reset(_postingsBytes, 0, termState.PostingsSize);
                _docId         = -1;
                _accum         = 0;
                _freq          = 1;
                _cost          = termState.DocFreq;
                _payloadLength = 0;
                this._liveDocs = liveDocs;
                return(this);
            }
            public PulsingDocsAndPositionsEnum Reset(Bits liveDocs, PulsingTermState termState)
            {
                Debug.Assert(termState.PostingsSize != -1);

                if (_postingsBytes == null)
                {
                    _postingsBytes = new byte[termState.PostingsSize];
                }
                else if (_postingsBytes.Length < termState.PostingsSize)
                {
                    _postingsBytes = ArrayUtil.Grow(_postingsBytes, termState.PostingsSize);
                }

                Array.Copy(termState.Postings, 0, _postingsBytes, 0, termState.PostingsSize);
                _postings.Reset(_postingsBytes, 0, termState.PostingsSize);
                this._liveDocs = liveDocs;
                _payloadLength = 0;
                _posPending    = 0;
                _docId         = -1;
                _accum         = 0;
                _cost          = termState.DocFreq;
                _startOffset   = _storeOffsets ? 0 : -1; // always return -1 if no offsets are stored
                _offsetLength  = 0;
                //System.out.println("PR d&p reset storesPayloads=" + storePayloads + " bytes=" + bytes.length + " this=" + this);
                return(this);
            }
Esempio n. 3
0
        public override BlockTermState NewTermState()
        {
            var state = new PulsingTermState {
                wrappedState = _wrappedPostingsWriter.NewTermState()
            };

            return(state);
        }
 public override BlockTermState NewTermState()
 {
     var state = new PulsingTermState {WrappedTermState = _wrappedPostingsReader.NewTermState()};
     return state;
 }
            public PulsingDocsAndPositionsEnum reset(Bits liveDocs, PulsingTermState termState)
            {
                Debug.Debug.Assert((termState.PostingsSize != -1);

                if (postingsBytes == null)
                {
                    postingsBytes = new byte[termState.PostingsSize];
                }
                else if (postingsBytes.Length < termState.PostingsSize)
                {
                    postingsBytes = ArrayUtil.Grow(postingsBytes, termState.PostingsSize);
                }

                System.Array.Copy(termState.Postings, 0, postingsBytes, 0, termState.PostingsSize);
                postings.Reset(postingsBytes, 0, termState.PostingsSize);
                this.liveDocs = liveDocs;
                payloadLength = 0;
                posPending = 0;
                docID = -1;
                accum = 0;
                cost = termState.DocFreq;
                startOffset = storeOffsets ? 0 : -1; // always return -1 if no offsets are stored
                offsetLength = 0;
                //System.out.println("PR d&p reset storesPayloads=" + storePayloads + " bytes=" + bytes.length + " this=" + this);
                return this;
            }
            public PulsingDocsEnum Reset(Bits liveDocs, PulsingTermState termState)
            {
                Debug.Debug.Assert((termState.PostingsSize != -1);

                // Must make a copy of termState's byte[] so that if
                // app does TermsEnum.next(), this DocsEnum is not affected
                if (postingsBytes == null)
                {
                    postingsBytes = new byte[termState.PostingsSize];
                }
                else if (postingsBytes.Length < termState.PostingsSize)
                {
                    postingsBytes = ArrayUtil.Grow(postingsBytes, termState.PostingsSize);
                }
                System.Array.Copy(termState.Postings, 0, postingsBytes, 0, termState.PostingsSize);
                postings.Reset(postingsBytes, 0, termState.PostingsSize);
                docID = -1;
                accum = 0;
                freq = 1;
                cost = termState.DocFreq;
                payloadLength = 0;
                this.liveDocs = liveDocs;
                return this;
            }
 public override BlockTermState NewTermState()
 {
     PulsingTermState state = new PulsingTermState();
     state.wrappedState = _wrappedPostingsWriter.NewTermState();
     return state;
 }
 public override BlockTermState NewTermState()
 {
     var state = new PulsingTermState {WRAPPED_STATE = _wrappedPostingsWriter.NewTermState()};
     return state;
 }