Пример #1
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;
			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;
		}
Пример #2
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;
     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;
     }
 }
Пример #3
0
 internal TermsHashPerThread AddThread(DocInverterPerThread docInverterPerThread, TermsHashPerThread primaryPerThread)
 {
     return(new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, primaryPerThread));
 }
Пример #4
0
        internal override void  Flush(IDictionary <InvertedDocConsumerPerThread, ICollection <InvertedDocConsumerPerField> > threadsAndFields, SegmentWriteState state)
        {
            lock (this)
            {
                var childThreadsAndFields = new Dictionary <TermsHashConsumerPerThread, ICollection <TermsHashConsumerPerField> >();
                Dictionary <InvertedDocConsumerPerThread, ICollection <InvertedDocConsumerPerField> > nextThreadsAndFields;

                if (nextTermsHash != null)
                {
                    nextThreadsAndFields = new Dictionary <InvertedDocConsumerPerThread, ICollection <InvertedDocConsumerPerField> >();
                }
                else
                {
                    nextThreadsAndFields = null;
                }

                foreach (var entry in threadsAndFields)
                {
                    TermsHashPerThread perThread = (TermsHashPerThread)entry.Key;

                    ICollection <InvertedDocConsumerPerField> fields = entry.Value;

                    var fieldsIt = fields.GetEnumerator();
                    ICollection <TermsHashConsumerPerField>   childFields = new HashSet <TermsHashConsumerPerField>();
                    ICollection <InvertedDocConsumerPerField> nextChildFields;

                    if (nextTermsHash != null)
                    {
                        nextChildFields = new HashSet <InvertedDocConsumerPerField>();
                    }
                    else
                    {
                        nextChildFields = null;
                    }

                    while (fieldsIt.MoveNext())
                    {
                        TermsHashPerField perField = (TermsHashPerField)fieldsIt.Current;
                        childFields.Add(perField.consumer);
                        if (nextTermsHash != null)
                        {
                            nextChildFields.Add(perField.nextPerField);
                        }
                    }

                    childThreadsAndFields[perThread.consumer] = childFields;
                    if (nextTermsHash != null)
                    {
                        nextThreadsAndFields[perThread.nextPerThread] = nextChildFields;
                    }
                }

                consumer.Flush(childThreadsAndFields, state);

                ShrinkFreePostings(threadsAndFields, state);

                if (nextTermsHash != null)
                {
                    nextTermsHash.Flush(nextThreadsAndFields, state);
                }
            }
        }
Пример #5
0
 public override TermsHashConsumerPerThread AddThread(TermsHashPerThread perThread)
 {
     return(new FreqProxTermsWriterPerThread(perThread));
 }
		public override TermsHashConsumerPerThread AddThread(TermsHashPerThread termsHashPerThread)
		{
			return new TermVectorsTermsWriterPerThread(termsHashPerThread, this);
		}
Пример #7
0
		internal TermsHashPerThread AddThread(DocInverterPerThread docInverterPerThread, TermsHashPerThread primaryPerThread)
		{
			return new TermsHashPerThread(docInverterPerThread, this, nextTermsHash, primaryPerThread);
		}
Пример #8
0
 public TermVectorsTermsWriterPerThread(TermsHashPerThread termsHashPerThread, TermVectorsTermsWriter termsWriter)
 {
     this.termsWriter        = termsWriter;
     this.termsHashPerThread = termsHashPerThread;
     docState = termsHashPerThread.docState;
 }
Пример #9
0
 public override TermsHashConsumerPerThread AddThread(TermsHashPerThread termsHashPerThread)
 {
     return(new TermVectorsTermsWriterPerThread(termsHashPerThread, this));
 }
Пример #10
0
 public abstract TermsHashConsumerPerThread AddThread(TermsHashPerThread perThread);
Пример #11
0
		public override TermsHashConsumerPerThread AddThread(TermsHashPerThread perThread)
		{
			return new FreqProxTermsWriterPerThread(perThread);
		}
		public TermVectorsTermsWriterPerThread(TermsHashPerThread termsHashPerThread, TermVectorsTermsWriter termsWriter)
		{
			this.termsWriter = termsWriter;
			this.termsHashPerThread = termsHashPerThread;
			docState = termsHashPerThread.docState;
		}
Пример #13
0
		public abstract TermsHashConsumerPerThread AddThread(TermsHashPerThread perThread);