Ejemplo n.º 1
0
            public override DocConsumer GetChain(DocumentsWriterPerThread documentsWriterPerThread)
            {
                /*
                 * this is the current indexing chain:
                 *
                 * DocConsumer / DocConsumerPerThread
                 * --> code: DocFieldProcessor
                 *  --> DocFieldConsumer / DocFieldConsumerPerField
                 *    --> code: DocFieldConsumers / DocFieldConsumersPerField
                 *      --> code: DocInverter / DocInverterPerField
                 *        --> InvertedDocConsumer / InvertedDocConsumerPerField
                 *          --> code: TermsHash / TermsHashPerField
                 *            --> TermsHashConsumer / TermsHashConsumerPerField
                 *              --> code: FreqProxTermsWriter / FreqProxTermsWriterPerField
                 *              --> code: TermVectorsTermsWriter / TermVectorsTermsWriterPerField
                 *        --> InvertedDocEndConsumer / InvertedDocConsumerPerField
                 *          --> code: NormsConsumer / NormsConsumerPerField
                 *  --> StoredFieldsConsumer
                 *    --> TwoStoredFieldConsumers
                 *      -> code: StoredFieldsProcessor
                 *      -> code: DocValuesProcessor
                 */

                // Build up indexing chain:

                TermsHashConsumer termVectorsWriter = new TermVectorsConsumer(documentsWriterPerThread);
                TermsHashConsumer freqProxWriter    = new FreqProxTermsWriter();

                InvertedDocConsumer  termsHash    = new TermsHash(documentsWriterPerThread, freqProxWriter, true, new TermsHash(documentsWriterPerThread, termVectorsWriter, false, null));
                NormsConsumer        normsWriter  = new NormsConsumer();
                DocInverter          docInverter  = new DocInverter(documentsWriterPerThread.docState, termsHash, normsWriter);
                StoredFieldsConsumer storedFields = new TwoStoredFieldsConsumers(new StoredFieldsProcessor(documentsWriterPerThread), new DocValuesProcessor(documentsWriterPerThread.bytesUsed));

                return(new DocFieldProcessor(documentsWriterPerThread, docInverter, storedFields));
            }
Ejemplo n.º 2
0
        internal bool hasPayloads; // if enabled, and we actually saw any for this field

        public TermVectorsConsumerPerField(TermsHashPerField termsHashPerField, TermVectorsConsumer termsWriter, FieldInfo fieldInfo)
        {
            this.termsHashPerField = termsHashPerField;
            this.termsWriter       = termsWriter;
            this.fieldInfo         = fieldInfo;
            docState   = termsHashPerField.docState;
            fieldState = termsHashPerField.fieldState;
        }
        internal bool HasPayloads; // if enabled, and we actually saw any for this field

        public TermVectorsConsumerPerField(TermsHashPerField termsHashPerField, TermVectorsConsumer termsWriter, FieldInfo fieldInfo)
        {
            this.TermsHashPerField = termsHashPerField;
            this.TermsWriter = termsWriter;
            this.FieldInfo = fieldInfo;
            DocState = termsHashPerField.DocState;
            FieldState = termsHashPerField.FieldState;
        }
            public override DocConsumer GetChain(DocumentsWriterPerThread documentsWriterPerThread)
            {
                /*
                this is the current indexing chain:

                DocConsumer / DocConsumerPerThread
                  --> code: DocFieldProcessor
                    --> DocFieldConsumer / DocFieldConsumerPerField
                      --> code: DocFieldConsumers / DocFieldConsumersPerField
                        --> code: DocInverter / DocInverterPerField
                          --> InvertedDocConsumer / InvertedDocConsumerPerField
                            --> code: TermsHash / TermsHashPerField
                              --> TermsHashConsumer / TermsHashConsumerPerField
                                --> code: FreqProxTermsWriter / FreqProxTermsWriterPerField
                                --> code: TermVectorsTermsWriter / TermVectorsTermsWriterPerField
                          --> InvertedDocEndConsumer / InvertedDocConsumerPerField
                            --> code: NormsConsumer / NormsConsumerPerField
                    --> StoredFieldsConsumer
                      --> TwoStoredFieldConsumers
                        -> code: StoredFieldsProcessor
                        -> code: DocValuesProcessor
                  */

                // Build up indexing chain:

                TermsHashConsumer termVectorsWriter = new TermVectorsConsumer(documentsWriterPerThread);
                TermsHashConsumer freqProxWriter = new FreqProxTermsWriter();

                InvertedDocConsumer termsHash = new TermsHash(documentsWriterPerThread, freqProxWriter, true, new TermsHash(documentsWriterPerThread, termVectorsWriter, false, null));
                NormsConsumer normsWriter = new NormsConsumer();
                DocInverter docInverter = new DocInverter(documentsWriterPerThread.docState, termsHash, normsWriter);
                StoredFieldsConsumer storedFields = new TwoStoredFieldsConsumers(new StoredFieldsProcessor(documentsWriterPerThread), new DocValuesProcessor(documentsWriterPerThread.bytesUsed));
                return new DocFieldProcessor(documentsWriterPerThread, docInverter, storedFields);
            }