Exemplo n.º 1
0
            internal 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));
            }
 public NormsConsumerPerField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo, NormsConsumer parent)
 {
     this.fieldInfo = fieldInfo;
     docState       = docInverterPerField.docState;
     fieldState     = docInverterPerField.fieldState;
     similarity     = docState.similarity;
 }