Beispiel #1
0
 private static void ProcessContainedInValue(object value, List<LuceneWork> queue, System.Type valueClass,
                                             DocumentBuilder builder, ISearchFactoryImplementor searchFactory)
 {
     object id = builder.idMapping.Getter.Get(value);
     builder.AddToWorkQueue(valueClass, value, id, WorkType.Update, queue, searchFactory);
 }
        private void InitDocumentBuilders(Configuration cfg, Analyzer analyzer)
        {
            DirectoryProviderFactory factory = new DirectoryProviderFactory();
            var classMappings = this.mapping.Build(cfg);

            foreach (var classMapping in classMappings)
            {
                System.Type mappedClass = classMapping.MappedClass;
                DirectoryProviderFactory.DirectoryProviders providers =
                    factory.CreateDirectoryProviders(classMapping, cfg, this);

                DocumentBuilder documentBuilder = new DocumentBuilder(classMapping, analyzer, providers.Providers, providers.SelectionStrategy);

                documentBuilders[mappedClass] = documentBuilder;
                BindFilterDefs(classMapping);
            }
            factory.StartDirectoryProviders();
        }
        private void InitDocumentBuilders(Configuration cfg, Analyzer analyzer)
        {
            DirectoryProviderFactory factory = new DirectoryProviderFactory();
            foreach (PersistentClass clazz in cfg.ClassMappings)
            {
                System.Type mappedClass = clazz.MappedClass;
                if (mappedClass != null)
                {
                    if (AttributeUtil.HasAttribute<IndexedAttribute>(mappedClass))
                    {
                        DirectoryProviderFactory.DirectoryProviders providers =
                            factory.CreateDirectoryProviders(mappedClass, cfg, this);

                        DocumentBuilder documentBuilder = new DocumentBuilder(mappedClass, analyzer, providers.Providers, providers.SelectionStrategy);

                        documentBuilders[mappedClass] = documentBuilder;
                    }
                    BindFilterDefs(mappedClass);
                }
            }
            factory.StartDirectoryProviders();
        }