Пример #1
0
        protected override void AddAllFields(Document document, Item item, bool versionSpecific)
        {
            Assert.ArgumentNotNull(document, "document");
            Assert.ArgumentNotNull(item, "item");

            foreach (var field in FilteredFields(item))
            {
                var value = ExtendedFieldCrawlerFactory.GetFieldCrawlerValue(field, FieldCrawlers);

                if (string.IsNullOrEmpty(value))
                {
                    continue;
                }

                var indexType   = GetIndexType(field);
                var storageType = GetStorageType(field);
                var vectorType  = GetVectorType(field);

                value = IdHelper.ProcessGUIDs(value);
                ProcessField(document, field.Key, value, storageType, indexType, vectorType);

                if (indexType == LuceneField.Index.TOKENIZED)
                {
                    ProcessField(document, BuiltinFields.Content, value, LuceneField.Store.NO, LuceneField.Index.TOKENIZED);
                }
            }

            ProcessDynamicFields(document, item);
        }
        protected virtual void ProcessField(SCField field, Document document)
        {
            var values = ExtendedFieldCrawlerFactory.GetFieldCrawlerValues(field, FieldCrawlers);

            foreach (var value in values)
            {
                ProcessFieldValue(field, document, value);
            }
        }
Пример #3
0
        /// <summary>
        /// Process the Field to be added to the index
        /// </summary>
        /// <param name="field">
        /// The field.
        /// </param>
        /// <param name="document">
        /// The document.
        /// </param>
        protected virtual void ProcessField(SCField field, Document document)
        {
            var value = ExtendedFieldCrawlerFactory.GetFieldCrawlerValue(field, this.FieldCrawlers);

            if (value.IsNullOrEmpty())
            {
                return;
            }

            if (field.TypeKey == "integer" || field.TypeKey == "number")
            {
                value = value.PadLeft(8, '0');
            }

            value = IdHelper.ProcessGUIDs(value);
            this.ProcessField(document, field.Key, value, this.GetStorageType(field), this.GetIndexType(field), this.GetVectorType(field));
            if (this.GetIndexType(field) == LuceneField.Index.TOKENIZED)
            {
                this.ProcessField(document, BuiltinFields.Content, value, LuceneField.Store.NO, LuceneField.Index.TOKENIZED);
            }
        }
        protected virtual void ProcessField(SCField field, Document document)
        {
            var value = ExtendedFieldCrawlerFactory.GetFieldCrawlerValue(field, FieldCrawlers);

            if (string.IsNullOrEmpty(value))
            {
                return;
            }

            var indexType   = GetIndexType(field);
            var storageType = GetStorageType(field);
            var vectorType  = GetVectorType(field);

            value = IdHelper.ProcessGUIDs(value);
            ProcessField(document, field.Key, value, storageType, indexType, vectorType);

            if (indexType == LuceneField.Index.TOKENIZED)
            {
                ProcessField(document, BuiltinFields.Content, value, LuceneField.Store.NO, LuceneField.Index.TOKENIZED);
            }
        }