예제 #1
0
 public NormsConsumerPerField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo, NormsConsumer parent)
 {
     this.fieldInfo = fieldInfo;
     docState       = docInverterPerField.docState;
     fieldState     = docInverterPerField.fieldState;
     similarity     = docState.similarity;
 }
 public NormsWriterPerField(DocInverterPerField docInverterPerField, NormsWriterPerThread perThread, FieldInfo fieldInfo)
 {
     this.perThread = perThread;
     this.fieldInfo = fieldInfo;
     docState = perThread.docState;
     fieldState = docInverterPerField.fieldState;
 }
예제 #3
0
 public NormsConsumerPerField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo, NormsConsumer parent)
 {
     this.FieldInfo = fieldInfo;
     DocState       = docInverterPerField.DocState;
     FieldState     = docInverterPerField.FieldState;
     Similarity     = DocState.Similarity;
 }
예제 #4
0
        public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHash termsHash, TermsHash nextTermsHash, FieldInfo fieldInfo)
        {
            IntPool        = termsHash.IntPool;
            BytePool       = termsHash.BytePool;
            TermBytePool   = termsHash.TermBytePool;
            DocState       = termsHash.DocState;
            this.TermsHash = termsHash;
            BytesUsed      = termsHash.BytesUsed;
            FieldState     = docInverterPerField.FieldState;
            this.Consumer  = termsHash.Consumer.AddField(this, fieldInfo);
            PostingsBytesStartArray byteStarts = new PostingsBytesStartArray(this, BytesUsed);

            BytesHash      = new BytesRefHash(TermBytePool, HASH_INIT_SIZE, byteStarts);
            StreamCount    = Consumer.StreamCount;
            NumPostingInt  = 2 * StreamCount;
            this.FieldInfo = fieldInfo;
            if (nextTermsHash != null)
            {
                NextPerField = (TermsHashPerField)nextTermsHash.AddField(docInverterPerField, fieldInfo);
            }
            else
            {
                NextPerField = null;
            }
        }
예제 #5
0
        public override void  Flush(System.Collections.IDictionary threadsAndFields, SegmentWriteState state)
        {
            System.Collections.IDictionary childThreadsAndFields    = new System.Collections.Hashtable();
            System.Collections.IDictionary endChildThreadsAndFields = new System.Collections.Hashtable();

            System.Collections.IEnumerator it = new System.Collections.Hashtable(threadsAndFields).GetEnumerator();
            while (it.MoveNext())
            {
                System.Collections.DictionaryEntry entry = (System.Collections.DictionaryEntry)it.Current;

                DocInverterPerThread perThread = (DocInverterPerThread)entry.Key;

                System.Collections.ICollection fields = (System.Collections.ICollection)entry.Value;

                System.Collections.IEnumerator fieldsIt       = fields.GetEnumerator();
                System.Collections.Hashtable   childFields    = new System.Collections.Hashtable();
                System.Collections.Hashtable   endChildFields = new System.Collections.Hashtable();
                while (fieldsIt.MoveNext())
                {
                    DocInverterPerField perField = (DocInverterPerField)((System.Collections.DictionaryEntry)fieldsIt.Current).Key;
                    childFields[perField.consumer]       = perField.consumer;
                    endChildFields[perField.endConsumer] = perField.endConsumer;
                }

                childThreadsAndFields[perThread.consumer]       = childFields;
                endChildThreadsAndFields[perThread.endConsumer] = endChildFields;
            }

            consumer.Flush(childThreadsAndFields, state);
            endConsumer.Flush(endChildThreadsAndFields, state);
        }
예제 #6
0
        public override void Flush(Support.Dictionary <DocFieldConsumerPerThread, IList <DocFieldConsumerPerField> > threadsAndFields, SegmentWriteState state)
        {
            Support.Dictionary <InvertedDocConsumerPerThread, IList <InvertedDocConsumerPerField> >       childThreadsAndFields    = new Support.Dictionary <InvertedDocConsumerPerThread, IList <InvertedDocConsumerPerField> >();
            Support.Dictionary <InvertedDocEndConsumerPerThread, IList <InvertedDocEndConsumerPerField> > endChildThreadsAndFields = new Support.Dictionary <InvertedDocEndConsumerPerThread, IList <InvertedDocEndConsumerPerField> >();

            foreach (KeyValuePair <DocFieldConsumerPerThread, IList <DocFieldConsumerPerField> > entry in new Support.Dictionary <DocFieldConsumerPerThread, IList <DocFieldConsumerPerField> >(threadsAndFields))
            {
                DocInverterPerThread perThread = (DocInverterPerThread)entry.Key;

                List <InvertedDocConsumerPerField>    childFields    = new List <InvertedDocConsumerPerField>();
                List <InvertedDocEndConsumerPerField> endChildFields = new List <InvertedDocEndConsumerPerField>();
                foreach (DocFieldConsumerPerField field in entry.Value)
                {
                    DocInverterPerField perField = (DocInverterPerField)field;
                    childFields.Add(perField.consumer);
                    endChildFields.Add(perField.endConsumer);
                }

                childThreadsAndFields[perThread.consumer]       = childFields;
                endChildThreadsAndFields[perThread.endConsumer] = endChildFields;
            }

            consumer.Flush(childThreadsAndFields, state);
            endConsumer.Flush(endChildThreadsAndFields, state);
        }
예제 #7
0
 public NormsConsumerPerField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo /*, NormsConsumer parent // LUCENENET: Not referenced */)
 {
     this.fieldInfo = fieldInfo;
     docState       = docInverterPerField.docState;
     fieldState     = docInverterPerField.fieldState;
     similarity     = docState.similarity;
 }
예제 #8
0
        public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHash termsHash, TermsHash nextTermsHash, FieldInfo fieldInfo)
        {
            intPool        = termsHash.intPool;
            bytePool       = termsHash.bytePool;
            termBytePool   = termsHash.termBytePool;
            docState       = termsHash.docState;
            this.termsHash = termsHash;
            bytesUsed      = termsHash.bytesUsed;
            fieldState     = docInverterPerField.fieldState;
            this.consumer  = termsHash.consumer.AddField(this, fieldInfo);
            PostingsBytesStartArray byteStarts = new PostingsBytesStartArray(this, bytesUsed);

            bytesHash      = new BytesRefHash(termBytePool, HASH_INIT_SIZE, byteStarts);
            streamCount    = consumer.StreamCount;
            numPostingInt  = 2 * streamCount;
            this.fieldInfo = fieldInfo;
            if (nextTermsHash != null)
            {
                nextPerField = (TermsHashPerField)nextTermsHash.AddField(docInverterPerField, fieldInfo);
            }
            else
            {
                nextPerField = null;
            }
        }
예제 #9
0
 public NormsWriterPerField(DocInverterPerField docInverterPerField, NormsWriterPerThread perThread, FieldInfo fieldInfo)
 {
     this.perThread = perThread;
     this.fieldInfo = fieldInfo;
     docState       = perThread.docState;
     fieldState     = docInverterPerField.fieldState;
 }
예제 #10
0
        public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHashPerThread perThread, TermsHashPerThread nextPerThread, FieldInfo fieldInfo)
        {
            InitBlock();
            this.perThread = perThread;

            intPool    = perThread.intPool;
            charPool   = perThread.charPool;
            bytePool   = perThread.bytePool;
            docState   = perThread.docState;
            fieldState = docInverterPerField.fieldState;

            // Sorter requires the char pool.
            _sorter = new Sorter <RawPostingList, PostingComparer>(new PostingComparer(this));

            this.consumer  = perThread.consumer.AddField(this, fieldInfo);
            streamCount    = consumer.GetStreamCount();
            numPostingInt  = 2 * streamCount;
            this.fieldInfo = fieldInfo;

            if (nextPerThread != null)
            {
                nextPerField = (TermsHashPerField)nextPerThread.AddField(docInverterPerField, fieldInfo);
            }
            else
            {
                nextPerField = null;
            }
        }
예제 #11
0
        internal override void Flush(IDictionary <string, DocFieldConsumerPerField> fieldsToFlush, SegmentWriteState state)
        {
            IDictionary <string, InvertedDocConsumerPerField>    childFieldsToFlush    = new Dictionary <string, InvertedDocConsumerPerField>();
            IDictionary <string, InvertedDocEndConsumerPerField> endChildFieldsToFlush = new Dictionary <string, InvertedDocEndConsumerPerField>();

            foreach (KeyValuePair <string, DocFieldConsumerPerField> fieldToFlush in fieldsToFlush)
            {
                DocInverterPerField perField = (DocInverterPerField)fieldToFlush.Value;
                childFieldsToFlush[fieldToFlush.Key]    = perField.consumer;
                endChildFieldsToFlush[fieldToFlush.Key] = perField.endConsumer;
            }

            consumer.Flush(childFieldsToFlush, state);
            endConsumer.Flush(endChildFieldsToFlush, state);
        }
 public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHashPerThread perThread, TermsHashPerThread nextPerThread, FieldInfo fieldInfo)
 {
     this.perThread = perThread;
     intPool = perThread.intPool;
     charPool = perThread.charPool;
     bytePool = perThread.bytePool;
     docState = perThread.docState;
     fieldState = docInverterPerField.fieldState;
     this.consumer = perThread.consumer.addField(this, fieldInfo);
     streamCount = consumer.getStreamCount();
     numPostingInt = 2 * streamCount;
     this.fieldInfo = fieldInfo;
     if (nextPerThread != null)
         nextPerField = (TermsHashPerField)nextPerThread.addField(docInverterPerField, fieldInfo);
     else
         nextPerField = null;
 }
예제 #13
0
        //internal override void flush(IDictionary<DocFieldConsumerPerThread, ICollection<DocFieldConsumerPerField>> threadsAndFields, DocumentsWriter.FlushState state)
        internal override void flush(IDictionary <object, ICollection <object> > threadsAndFields, DocumentsWriter.FlushState state)
        {
            //IDictionary<DocFieldConsumerPerThread, ICollection<DocFieldConsumerPerField>> childThreadsAndFields = new Dictionary<DocFieldConsumerPerThread, ICollection<DocFieldConsumerPerField>>();
            //IDictionary<DocFieldConsumerPerThread, ICollection<DocFieldConsumerPerField>> endChildThreadsAndFields = new Dictionary<DocFieldConsumerPerThread, ICollection<DocFieldConsumerPerField>>();
            IDictionary <object, ICollection <object> > childThreadsAndFields    = new Dictionary <object, ICollection <object> >();
            IDictionary <object, ICollection <object> > endChildThreadsAndFields = new Dictionary <object, ICollection <object> >();

            //IEnumerator<KeyValuePair<DocFieldConsumerPerThread, ICollection<DocFieldConsumerPerField>>> it = threadsAndFields.GetEnumerator();
            IEnumerator <KeyValuePair <object, ICollection <object> > > it = threadsAndFields.GetEnumerator();

            while (it.MoveNext())
            {
                //KeyValuePair<DocFieldConsumerPerThread, ICollection<DocFieldConsumerPerField>> entry = it.Current;
                KeyValuePair <object, ICollection <object> > entry = it.Current;

                DocInverterPerThread perThread = (DocInverterPerThread)entry.Key;

                //ICollection<DocFieldConsumerPerField> fields = entry.Value;
                ICollection <object> fields = entry.Value;
                //IEnumerator<DocFieldConsumerPerField> fieldsIt = fields.GetEnumerator();
                IEnumerator <object> fieldsIt = fields.GetEnumerator();

                //IDictionary<DocFieldConsumerPerField, DocFieldConsumerPerField> childFields = new Dictionary<DocFieldConsumerPerField, DocFieldConsumerPerField>();
                //IDictionary<DocFieldConsumerPerField, DocFieldConsumerPerField> endChildFields = new Dictionary<DocFieldConsumerPerField, DocFieldConsumerPerField>();
                IDictionary <object, object> childFields    = new Dictionary <object, object>();
                IDictionary <object, object> endChildFields = new Dictionary <object, object>();

                while (fieldsIt.MoveNext())
                {
                    DocInverterPerField perField = (DocInverterPerField)fieldsIt.Current;
                    childFields[perField.consumer]       = perField.consumer;
                    endChildFields[perField.endConsumer] = perField.endConsumer;
                }

                childThreadsAndFields[perThread.consumer] = childFields.Keys;
                // create new collection to provide for deletions in NormsWriter
                endChildThreadsAndFields[perThread.endConsumer] = new List <object>(endChildFields.Keys);
            }

            consumer.flush(childThreadsAndFields, state);
            endConsumer.flush(endChildThreadsAndFields, state);
        }
 public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHashPerThread perThread, TermsHashPerThread nextPerThread, FieldInfo fieldInfo)
 {
     this.perThread = perThread;
     intPool        = perThread.intPool;
     charPool       = perThread.charPool;
     bytePool       = perThread.bytePool;
     docState       = perThread.docState;
     fieldState     = docInverterPerField.fieldState;
     this.consumer  = perThread.consumer.addField(this, fieldInfo);
     streamCount    = consumer.getStreamCount();
     numPostingInt  = 2 * streamCount;
     this.fieldInfo = fieldInfo;
     if (nextPerThread != null)
     {
         nextPerField = (TermsHashPerField)nextPerThread.addField(docInverterPerField, fieldInfo);
     }
     else
     {
         nextPerField = null;
     }
 }
예제 #15
0
 public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHash termsHash, TermsHash nextTermsHash, FieldInfo fieldInfo)
 {
     IntPool = termsHash.IntPool;
     BytePool = termsHash.BytePool;
     TermBytePool = termsHash.TermBytePool;
     DocState = termsHash.DocState;
     this.TermsHash = termsHash;
     BytesUsed = termsHash.BytesUsed;
     FieldState = docInverterPerField.FieldState;
     this.Consumer = termsHash.Consumer.AddField(this, fieldInfo);
     PostingsBytesStartArray byteStarts = new PostingsBytesStartArray(this, BytesUsed);
     BytesHash = new BytesRefHash(TermBytePool, HASH_INIT_SIZE, byteStarts);
     StreamCount = Consumer.StreamCount;
     NumPostingInt = 2 * StreamCount;
     this.FieldInfo = fieldInfo;
     if (nextTermsHash != null)
     {
         NextPerField = (TermsHashPerField)nextTermsHash.AddField(docInverterPerField, fieldInfo);
     }
     else
     {
         NextPerField = null;
     }
 }
예제 #16
0
 internal abstract InvertedDocEndConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo);
예제 #17
0
 internal override InvertedDocEndConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo)
 {
     return new NormsConsumerPerField(docInverterPerField, fieldInfo, this);
 }
예제 #18
0
 internal override InvertedDocEndConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo)
 {
     return(new NormsConsumerPerField(docInverterPerField, fieldInfo /* , this // LUCENENET: Not referenced */));
 }
예제 #19
0
 internal override InvertedDocConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo)
 {
     return(new TermsHashPerField(docInverterPerField, this, nextPerThread, fieldInfo));
 }
		internal override InvertedDocConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo)
		{
			return new TermsHashPerField(docInverterPerField, this, nextPerThread, fieldInfo);
		}
예제 #21
0
 internal override InvertedDocEndConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo)
 {
     return(new NormsWriterPerField(docInverterPerField, this, fieldInfo));
 }
 internal abstract InvertedDocEndConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo);